forked from minhngoc25a/freetype2
Small fixes and formatting.
This commit is contained in:
parent
2bc7c45b5f
commit
645a153c0d
|
@ -70,14 +70,14 @@ endif
|
||||||
|
|
||||||
# The directory where all library files are placed.
|
# The directory where all library files are placed.
|
||||||
#
|
#
|
||||||
# By default, this is the same as $(OBJ_DIR), however, this can be changed
|
# By default, this is the same as $(OBJ_DIR); however, this can be changed
|
||||||
# to suit particular needs.
|
# to suit particular needs.
|
||||||
#
|
#
|
||||||
LIB_DIR := $(OBJ_DIR)
|
LIB_DIR := $(OBJ_DIR)
|
||||||
|
|
||||||
|
|
||||||
# the NO_OUTPUT macro is appended to command lines in order to ignore
|
# the NO_OUTPUT macro is appended to command lines in order to ignore
|
||||||
# the output of some programs..
|
# the output of some programs.
|
||||||
#
|
#
|
||||||
NO_OUTPUT := 2> /dev/null
|
NO_OUTPUT := 2> /dev/null
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,6 @@ while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--prefix=*)
|
--prefix=*)
|
||||||
prefix=$optarg
|
prefix=$optarg
|
||||||
if test $exec_prefix_set = no ; then
|
|
||||||
exec_prefix=$optarg
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
--prefix)
|
--prefix)
|
||||||
echo_prefix=yes
|
echo_prefix=yes
|
||||||
|
@ -63,6 +60,10 @@ while test $# -gt 0; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if test "$exec_prefix_set" = "no"; then
|
||||||
|
exec_prefix=$prefix
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$echo_prefix" = "yes"; then
|
if test "$echo_prefix" = "yes"; then
|
||||||
echo $prefix
|
echo $prefix
|
||||||
fi
|
fi
|
||||||
|
@ -78,4 +79,4 @@ if test "$echo_libs" = "yes"; then
|
||||||
echo -L@libdir@ $libs
|
echo -L@libdir@ $libs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# EOF
|
||||||
|
|
|
@ -37,7 +37,7 @@ install: $(PROJECT_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
-$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/lib$(PROJECT).$A
|
-$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(PROJECT_LIBRARY)
|
||||||
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
|
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
|
||||||
-$(DELDIR) $(includedir)/freetype2/freetype/cache
|
-$(DELDIR) $(includedir)/freetype2/freetype/cache
|
||||||
-$(DELETE) $(includedir)/freetype2/freetype/config/*
|
-$(DELETE) $(includedir)/freetype2/freetype/config/*
|
||||||
|
@ -52,12 +52,12 @@ uninstall:
|
||||||
|
|
||||||
# Unix cleaning and distclean rules.
|
# Unix cleaning and distclean rules.
|
||||||
#
|
#
|
||||||
clean_project_unix:
|
clean_project_cygwin:
|
||||||
-$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)
|
-$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)
|
||||||
-$(DELETE) $(patsubst %.$O,%.$(SO),$(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)) \
|
-$(DELETE) $(patsubst %.$O,%.$(SO),$(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)) \
|
||||||
$(CLEAN)
|
$(CLEAN)
|
||||||
|
|
||||||
distclean_project_unix: clean_project_unix
|
distclean_project_cygwin: clean_project_cygwin
|
||||||
-$(DELETE) $(PROJECT_LIBRARY)
|
-$(DELETE) $(PROJECT_LIBRARY)
|
||||||
-$(DELETE) $(OBJ_DIR)/.libs/*
|
-$(DELETE) $(OBJ_DIR)/.libs/*
|
||||||
-$(DELDIR) $(OBJ_DIR)/.libs
|
-$(DELDIR) $(OBJ_DIR)/.libs
|
||||||
|
|
|
@ -32,9 +32,6 @@ while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--prefix=*)
|
--prefix=*)
|
||||||
prefix=$optarg
|
prefix=$optarg
|
||||||
if test $exec_prefix_set = no ; then
|
|
||||||
exec_prefix=$optarg
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
--prefix)
|
--prefix)
|
||||||
echo_prefix=yes
|
echo_prefix=yes
|
||||||
|
@ -63,6 +60,10 @@ while test $# -gt 0; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if test "$exec_prefix_set" = "no"; then
|
||||||
|
exec_prefix=$prefix
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$echo_prefix" = "yes"; then
|
if test "$echo_prefix" = "yes"; then
|
||||||
echo $prefix
|
echo $prefix
|
||||||
fi
|
fi
|
||||||
|
@ -78,4 +79,4 @@ if test "$echo_libs" = "yes"; then
|
||||||
echo -L@libdir@ $libs
|
echo -L@libdir@ $libs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# EOF
|
||||||
|
|
|
@ -37,7 +37,7 @@ install: $(PROJECT_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
-$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/lib$(PROJECT).$A
|
-$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/$(PROJECT_LIBRARY)
|
||||||
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
|
-$(DELETE) $(includedir)/freetype2/freetype/cache/*
|
||||||
-$(DELDIR) $(includedir)/freetype2/freetype/cache
|
-$(DELDIR) $(includedir)/freetype2/freetype/cache
|
||||||
-$(DELETE) $(includedir)/freetype2/freetype/config/*
|
-$(DELETE) $(includedir)/freetype2/freetype/config/*
|
||||||
|
|
|
@ -177,18 +177,16 @@
|
||||||
|
|
||||||
/* chunk set objects */
|
/* chunk set objects */
|
||||||
|
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( void ) FTC_ChunkNode_Destroy( FTC_ChunkNode node );
|
||||||
FTC_ChunkNode_Destroy( FTC_ChunkNode node );
|
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error ) FTC_ChunkSet_New ( FTC_Chunk_Cache cache,
|
||||||
FTC_ChunkSet_New( FTC_Chunk_Cache cache,
|
|
||||||
FT_Pointer type,
|
FT_Pointer type,
|
||||||
FTC_ChunkSet *aset );
|
FTC_ChunkSet *aset );
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error ) FTC_ChunkSet_Lookup_Node(
|
||||||
FTC_ChunkSet_Lookup_Node( FTC_ChunkSet cset,
|
FTC_ChunkSet cset,
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FTC_ChunkNode* anode,
|
FTC_ChunkNode* anode,
|
||||||
FT_UInt *anindex );
|
FT_UInt *anindex );
|
||||||
|
@ -196,16 +194,11 @@
|
||||||
|
|
||||||
/* chunk cache objects */
|
/* chunk cache objects */
|
||||||
|
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error ) FTC_Chunk_Cache_Init ( FTC_Chunk_Cache cache );
|
||||||
FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache );
|
|
||||||
|
|
||||||
|
FT_EXPORT( void ) FTC_Chunk_Cache_Done ( FTC_Chunk_Cache cache );
|
||||||
|
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( FT_Error ) FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
|
||||||
FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache );
|
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT( FT_Error )
|
|
||||||
FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
|
|
||||||
FT_Pointer type,
|
FT_Pointer type,
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FTC_ChunkNode *anode,
|
FTC_ChunkNode *anode,
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
/* will flush as many old cache nodes as possible (ignoring cache */
|
/* will flush as many old cache nodes as possible (ignoring cache */
|
||||||
/* nodes with a non-zero reference count). */
|
/* nodes with a non-zero reference count). */
|
||||||
/* */
|
/* */
|
||||||
/* <Input> */
|
/* <InOut> */
|
||||||
/* manager :: A handle to the cache manager. */
|
/* manager :: A handle to the cache manager. */
|
||||||
/* */
|
/* */
|
||||||
/* <Note> */
|
/* <Note> */
|
||||||
|
@ -212,6 +212,9 @@
|
||||||
/* */
|
/* */
|
||||||
/* cache_data :: A generic pointer passed to the destructor. */
|
/* cache_data :: A generic pointer passed to the destructor. */
|
||||||
/* */
|
/* */
|
||||||
|
/* <Return> */
|
||||||
|
/* The size of a given cache node in bytes. */
|
||||||
|
/* */
|
||||||
typedef FT_ULong (*FTC_CacheNode_SizeFunc)( FTC_CacheNode node,
|
typedef FT_ULong (*FTC_CacheNode_SizeFunc)( FTC_CacheNode node,
|
||||||
FT_Pointer cache_data );
|
FT_Pointer cache_data );
|
||||||
|
|
||||||
|
@ -254,7 +257,6 @@
|
||||||
/* the cache manager never allocates cache node directly; it */
|
/* the cache manager never allocates cache node directly; it */
|
||||||
/* delegates this task to its cache objects. */
|
/* delegates this task to its cache objects. */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
|
||||||
typedef struct FTC_CacheNode_Class_
|
typedef struct FTC_CacheNode_Class_
|
||||||
{
|
{
|
||||||
FTC_CacheNode_SizeFunc size_node;
|
FTC_CacheNode_SizeFunc size_node;
|
||||||
|
|
|
@ -79,12 +79,11 @@
|
||||||
} FT_LruNodeRec, *FT_LruNode;
|
} FT_LruNodeRec, *FT_LruNode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* forward declaration */
|
/* forward declaration */
|
||||||
typedef struct FT_LruRec_* FT_Lru;
|
typedef struct FT_LruRec_* FT_Lru;
|
||||||
|
|
||||||
|
|
||||||
/* LRU clazz */
|
/* LRU class */
|
||||||
typedef struct FT_Lru_Class_
|
typedef struct FT_Lru_Class_
|
||||||
{
|
{
|
||||||
FT_UInt lru_size; /* object size in bytes */
|
FT_UInt lru_size; /* object size in bytes */
|
||||||
|
|
|
@ -183,7 +183,7 @@
|
||||||
FT_ListNode lrunode;
|
FT_ListNode lrunode;
|
||||||
|
|
||||||
|
|
||||||
if (node)
|
if ( node )
|
||||||
{
|
{
|
||||||
lrunode = FTC_CHUNKNODE_TO_LRUNODE( node );
|
lrunode = FTC_CHUNKNODE_TO_LRUNODE( node );
|
||||||
|
|
||||||
|
@ -220,6 +220,7 @@
|
||||||
|
|
||||||
|
|
||||||
*anode = 0;
|
*anode = 0;
|
||||||
|
|
||||||
if ( glyph_index >= cset->element_max )
|
if ( glyph_index >= cset->element_max )
|
||||||
error = FT_Err_Invalid_Argument;
|
error = FT_Err_Invalid_Argument;
|
||||||
else
|
else
|
||||||
|
@ -350,19 +351,19 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error ) FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache )
|
||||||
FTC_Chunk_Cache_Init( FTC_Chunk_Cache cache )
|
|
||||||
{
|
{
|
||||||
FT_Memory memory = cache->root.memory;
|
FT_Memory memory = cache->root.memory;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
FTC_Chunk_Cache_Class* ccache_clazz;
|
FTC_Chunk_Cache_Class* ccache_clazz;
|
||||||
|
|
||||||
|
|
||||||
/* set up root node_class to be used by manager */
|
/* set up root node_class to be used by manager */
|
||||||
cache->root.node_clazz =
|
cache->root.node_clazz =
|
||||||
(FTC_CacheNode_Class*)&ftc_chunk_cache_node_class;
|
(FTC_CacheNode_Class*)&ftc_chunk_cache_node_class;
|
||||||
|
|
||||||
/* setup "compare" shortcut */
|
/* setup `compare' shortcut */
|
||||||
ccache_clazz = (FTC_Chunk_Cache_Class*)cache->root.clazz;
|
ccache_clazz = (FTC_Chunk_Cache_Class*)cache->root.clazz;
|
||||||
cache->compare = ccache_clazz->cset_class->compare;
|
cache->compare = ccache_clazz->cset_class->compare;
|
||||||
|
|
||||||
|
@ -376,15 +377,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT_DEF( void )
|
FT_EXPORT_DEF( void ) FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache )
|
||||||
FTC_Chunk_Cache_Done( FTC_Chunk_Cache cache )
|
|
||||||
{
|
{
|
||||||
/* discard glyph sets */
|
/* discard glyph sets */
|
||||||
FT_Lru_Done( cache->csets_lru );
|
FT_Lru_Done( cache->csets_lru );
|
||||||
}
|
}
|
||||||
|
|
||||||
FT_EXPORT_DEF( FT_Error )
|
|
||||||
FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
|
FT_EXPORT_DEF( FT_Error ) FTC_Chunk_Cache_Lookup( FTC_Chunk_Cache cache,
|
||||||
FT_Pointer type,
|
FT_Pointer type,
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FTC_ChunkNode *anode,
|
FTC_ChunkNode *anode,
|
||||||
|
@ -436,4 +436,5 @@
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
@ -377,19 +377,19 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error ) FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache )
|
||||||
FTC_Glyph_Cache_Init( FTC_Glyph_Cache cache )
|
|
||||||
{
|
{
|
||||||
FT_Memory memory = cache->root.memory;
|
FT_Memory memory = cache->root.memory;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
FTC_Glyph_Cache_Class* gcache_clazz;
|
FTC_Glyph_Cache_Class* gcache_clazz;
|
||||||
|
|
||||||
|
|
||||||
/* set up root node_class to be used by manager */
|
/* set up root node_class to be used by manager */
|
||||||
cache->root.node_clazz =
|
cache->root.node_clazz =
|
||||||
(FTC_CacheNode_Class*)&ftc_glyph_cache_node_class;
|
(FTC_CacheNode_Class*)&ftc_glyph_cache_node_class;
|
||||||
|
|
||||||
/* setup the "compare" shortcut */
|
/* setup the `compare' shortcut */
|
||||||
gcache_clazz = (FTC_Glyph_Cache_Class*)cache->root.clazz;
|
gcache_clazz = (FTC_Glyph_Cache_Class*)cache->root.clazz;
|
||||||
cache->compare = gcache_clazz->gset_class->compare;
|
cache->compare = gcache_clazz->gset_class->compare;
|
||||||
|
|
||||||
|
@ -410,16 +410,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT_DEF( void )
|
FT_EXPORT_DEF( void ) FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache )
|
||||||
FTC_Glyph_Cache_Done( FTC_Glyph_Cache cache )
|
|
||||||
{
|
{
|
||||||
/* discard glyph sets */
|
/* discard glyph sets */
|
||||||
FT_Lru_Done( cache->gsets_lru );
|
FT_Lru_Done( cache->gsets_lru );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_EXPORT_DEF( FT_Error )
|
FT_EXPORT_DEF( FT_Error ) FTC_Glyph_Cache_Lookup( FTC_Glyph_Cache cache,
|
||||||
FTC_Glyph_Cache_Lookup( FTC_Glyph_Cache cache,
|
|
||||||
FT_Pointer type,
|
FT_Pointer type,
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FTC_GlyphNode *anode )
|
FTC_GlyphNode *anode )
|
||||||
|
@ -429,6 +427,7 @@
|
||||||
FTC_GlyphNode node;
|
FTC_GlyphNode node;
|
||||||
FTC_Manager manager;
|
FTC_Manager manager;
|
||||||
|
|
||||||
|
|
||||||
/* check for valid `desc' delayed to FT_Lru_Lookup() */
|
/* check for valid `desc' delayed to FT_Lru_Lookup() */
|
||||||
|
|
||||||
if ( !cache || !anode )
|
if ( !cache || !anode )
|
||||||
|
@ -436,6 +435,7 @@
|
||||||
|
|
||||||
*anode = 0;
|
*anode = 0;
|
||||||
gset = cache->last_gset;
|
gset = cache->last_gset;
|
||||||
|
|
||||||
if ( !gset || !cache->compare( gset, type ) )
|
if ( !gset || !cache->compare( gset, type ) )
|
||||||
{
|
{
|
||||||
error = FT_Lru_Lookup( cache->gsets_lru,
|
error = FT_Lru_Lookup( cache->gsets_lru,
|
||||||
|
@ -465,4 +465,5 @@
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
FT_CALLBACK_DEF
|
FT_CALLBACK_DEF
|
||||||
FT_Error ftc_glyph_image_node_new( FTC_GlyphSet gset,
|
FT_Error ftc_glyph_image_node_new( FTC_GlyphSet gset,
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FTC_GlyphImage* anode )
|
FTC_GlyphImage *anode )
|
||||||
{
|
{
|
||||||
FT_Memory memory = gset->memory;
|
FT_Memory memory = gset->memory;
|
||||||
FTC_ImageSet imageset = (FTC_ImageSet)gset;
|
FTC_ImageSet imageset = (FTC_ImageSet)gset;
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
FT_CALLBACK_DEF
|
FT_CALLBACK_DEF
|
||||||
FT_Error ftc_sbit_chunk_node_new( FTC_ChunkSet cset,
|
FT_Error ftc_sbit_chunk_node_new( FTC_ChunkSet cset,
|
||||||
FT_UInt index,
|
FT_UInt index,
|
||||||
FTC_ChunkNode* anode )
|
FTC_ChunkNode *anode )
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FT_Memory memory = cset->memory;
|
FT_Memory memory = cset->memory;
|
||||||
|
@ -373,14 +373,15 @@
|
||||||
FTC_ChunkNode node;
|
FTC_ChunkNode node;
|
||||||
FT_UInt cindex;
|
FT_UInt cindex;
|
||||||
|
|
||||||
|
|
||||||
/* argument checks delayed to FTC_Chunk_Cache_Lookup */
|
/* argument checks delayed to FTC_Chunk_Cache_Lookup */
|
||||||
if (!ansbit)
|
if ( !ansbit )
|
||||||
return FT_Err_Invalid_Argument;
|
return FT_Err_Invalid_Argument;
|
||||||
|
|
||||||
*ansbit = 0;
|
*ansbit = 0;
|
||||||
error = FTC_Chunk_Cache_Lookup( &cache->root, desc, gindex,
|
error = FTC_Chunk_Cache_Lookup( &cache->root, desc, gindex,
|
||||||
&node, &cindex );
|
&node, &cindex );
|
||||||
if (!error)
|
if ( !error )
|
||||||
*ansbit = (FTC_SBit)node->elements + cindex;
|
*ansbit = (FTC_SBit)node->elements + cindex;
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
Loading…
Reference in New Issue