ref: fefd8742928491a9da356cc1c37f434c76d73514
parent: c12ec72c2fb3cf14a546759ea9c74401bc4abd45
author: Werner Lemberg <[email protected]>
date: Sat Jun 12 09:21:20 EDT 2004
* docs/CHANGES: Updated. Minor clean-ups.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,29 +1,62 @@
+2004-06-11 Werner Lemberg <[email protected]>
+
+ * docs/CHANGES: Updated.
+
2004-06-10 David Turner <[email protected]>
- * src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
- src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c:
- removing obsolete files
+ * src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
+ src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
+ Obsolete.
+ * src/raster/ftraster.c (Alignment, PAlignment): New union to fix
+ problems with 64bit systems.
+ (AlignProfileSize): Use it.
+
2004-06-08 David Turner <[email protected]>
- * include/freetype/freetype.h (FT_Glyph_Metrics, FT_GlyphSlotRec),
- src/autofit/afloader.c, src/autohint/ahhint.c:
- moved the definition of 'lsb_delta' and 'rsb_delta' from FT_GlyphMetrics
- to FT_GlyphSlotRec. The old location did BREAK BINARY COMPATIBILITY
- of the library !!
+ * include/freetype/freetype.h (FT_GlyphMetrics): Move `lsb_delta'
+ and `rsb_delta' elements to...
+ (FT_GlyphSlotRec): Here to retain binary compatibility with older
+ FreeType versions.
+ Update all users.
- * src/sfnt/sfobjs.c: removing compiler warning
+ * src/sfnt/sfobjs.c (tt_face_get_name): Remove compiler warning.
- * src/winfonts/winfnt.c: adding missing initialization of the
- slot->metrics.width and slot->metrics.height when loading a Windows
- FNT glyph. Thanks to Huw Davies
+ * src/winfonts/winfnt.c (FNT_Load_Glyph): Add missing initialization
+ of slot->metrics.width and slot->metrics.height when loading a
+ Windows FNT glyph. Thanks to Huw Davies.
- * include/freetype/cache/ftcmru.h, src/cache/ftcbasic.c,
- src/cache/ftccache.c, src/cache/ftcglyph.c, src/cache/ftcmanag.c,
- src/cache/ftcsbits.c:
- fixing some annoying bugs and inefficiencies in the cache sub-system.
+ * include/freetype/cache/ftcmru.h (FTC_MruNode_CompareFunc): Change
+ return type to FT_Bool.
+ * src/cache/ftbasic.c (ftc_basic_family_compare): Change return
+ type to FT_Bool.
+ * src/cache/ftccache.c (FTC_Cache_Init, ftc_cache_init): Make
+ the former call the latter, not vice versa.
+ (FTC_Cache_Done, ftc_cache_done): Ditto.
+
+ * src/cache/ftcglyph.c (FTC_GNode_Compare, ftc_gnode_compare): Make
+ the former call the latter, not vice versa.
+ (FTC_GCache_Init, ftc_gcache_init): Ditto.
+ (FTC_GCache_Done, ftc_gcache_done): Ditto.
+
+ * src/cache/ftcimage.c (FTC_INode_Free, ftc_inode_free): Make the
+ former call the latter, not vice versa.
+ (FTC_INode_Weight, ftc_inode_weight): Ditto.
+
+ * src/cache/ftcmanag.c (ftc_size_node_compare,
+ ftc_size_node_compare_faceid, ftc_face_node_compare): Change return
+ type to FT_Bool.
+
+ * src/cache/ftcsbits.c (FTC_SNode_Free, ftc_snode_free): Make the
+ former call the latter, not vice versa.
+ (FTC_SNode_Weight, ftc_snode_weight): Ditto.
+ (FTC_SNode_Compare, ftc_snode_compare): Ditto.
+
+ * src/cache/ftcsbits.c: Fix some bugs and inefficiencies in the cache
+ sub-system.
+
2004-06-05 Werner Lemberg <[email protected]>
* src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and
@@ -36,6 +69,9 @@
2004-06-04 David Chester <[email protected]>
Improve inter-letter spacing for autohinted glyphs.
+
+ * include/freetype/freetype.h (FT_Glyph_Metrics): Add elements
+ `lsb_delta' and `rsb_delta'.
* src/autohint/ahhint.c (ah_hinter_load): Set `lsb_delta' and
`rsb_delta' in slot->metrics and tune side bearings slightly.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -20,11 +20,11 @@
and `gvar' tables; the Multiple Masters API has been slightly
extended to cope with the new functionality).
- - The `FT_Glyph_Metrics' structure has been extended: The elements
+ - The `FT_GlyphSlotRec' structure has been extended: The elements
`lsb_delta' and `rsb_delta' give the difference between hinted
and unhinted left and right side bearings if autohinting is
active. Using those values can improve the inter-letter spacing
- considerably. See the documentation of `FT_Glyph_Metrics' and
+ considerably. See the documentation of `FT_GlyphSlotRec' and
the `ftstring' demo program how to use it.
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1468,13 +1468,13 @@
/* Note that the app will need to know about the */
/* image format. */
/* */
- /* lsb_delta :: */
- /* The difference between hinted and unhinted left side bearing */
- /* while autohinting is active. Zero otherwise. */
+ /* lsb_delta :: The difference between hinted and unhinted */
+ /* left side bearing while autohinting is */
+ /* active. Zero otherwise. */
/* */
- /* rsb_delta :: */
- /* The difference between hinted and unhinted right side bearing */
- /* while autohinting is active. Zero otherwise. */
+ /* rsb_delta :: The difference between hinted and unhinted */
+ /* right side bearing while autohinting is */
+ /* active. Zero otherwise. */
/* */
/* <Note> */
/* If @FT_Load_Glyph is called with default flags (see */
@@ -1496,32 +1496,32 @@
/* `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' . */
/* */
/* <Note> */
- /* Here a small pseudo code fragment which shows how to use */
- /* `lsb_delta' and `rsb_delta': */
- /* { */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
+ /* Here a small pseudo code fragment which shows how to use */
+ /* `lsb_delta' and `rsb_delta': */
/* */
+ /* { */
+ /* FT_Pos origin_x = 0; */
+ /* FT_Pos prev_rsb_delta = 0; */
/* */
- /* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
/* */
- /* <load glyph with `FT_Load_Glyph'> */
+ /* for all glyphs do */
+ /* <compute kern between current and previous glyph and add it to */
+ /* `origin_x'> */
/* */
- /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
- /* origin_x -= 64; */
- /* else if */
- /* ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
- /* origin_x += 64; */
+ /* <load glyph with `FT_Load_Glyph'> */
/* */
- /* prev_rsb_delta = face->glyph->rsb_delta; */
+ /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+ /* origin_x -= 64; */
+ /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+ /* origin_x += 64; */
/* */
- /* <save glyph image, or render glyph, or ...> */
+ /* prev_rsb_delta = face->glyph->rsb_delta; */
/* */
- /* origin_x += face->glyph->advance.x; */
- /* endfor */
- /* } */
+ /* <save glyph image, or render glyph, or ...> */
+ /* */
+ /* origin_x += face->glyph->advance.x; */
+ /* endfor */
+ /* } */
/* */
typedef struct FT_GlyphSlotRec_
{
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -73,6 +73,7 @@
FTC_GQuery gquery = (FTC_GQuery)ftcgquery;
FT_UNUSED( cache );
+
return FT_BOOL( gnode->family == gquery->family &&
gnode->gindex == gquery->gindex );
}
@@ -82,7 +83,7 @@
FTC_GNode_Compare( FTC_GNode gnode,
FTC_GQuery gquery )
{
- return ftc_gnode_compare( FTC_NODE(gnode), gquery, NULL );
+ return ftc_gnode_compare( FTC_NODE( gnode ), gquery, NULL );
}
@@ -113,6 +114,7 @@
FTC_GCache cache = (FTC_GCache)ftccache;
FT_Error error;
+
error = FTC_Cache_Init( FTC_CACHE( cache ) );
if ( !error )
{
@@ -132,17 +134,10 @@
FT_EXPORT_DEF( FT_Error )
FTC_GCache_Init( FTC_GCache cache )
{
- return ftc_gcache_init( FTC_CACHE(cache) );
+ return ftc_gcache_init( FTC_CACHE( cache ) );
}
- FT_EXPORT_DEF( void )
- FTC_GCache_Done( FTC_GCache cache )
- {
- ftc_gcache_done( FTC_CACHE(cache) );
- }
-
-
FT_LOCAL_DEF( void )
ftc_gcache_done( FTC_Cache ftccache )
{
@@ -151,6 +146,13 @@
FTC_Cache_Done( (FTC_Cache)cache );
FTC_MruList_Done( &cache->families );
+ }
+
+
+ FT_EXPORT_DEF( void )
+ FTC_GCache_Done( FTC_GCache cache )
+ {
+ ftc_gcache_done( FTC_CACHE( cache ) );
}
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -45,13 +45,11 @@
}
-
-
FT_EXPORT_DEF( void )
FTC_INode_Free( FTC_INode inode,
FTC_Cache cache )
{
- ftc_inode_free( FTC_NODE(inode), cache );
+ ftc_inode_free( FTC_NODE( inode ), cache );
}
@@ -108,8 +106,9 @@
FT_ULong size = 0;
FT_Glyph glyph = inode->glyph;
- FT_UNUSED(ftccache);
+ FT_UNUSED( ftccache );
+
switch ( glyph->format )
{
case FT_GLYPH_FORMAT_BITMAP:
@@ -145,12 +144,10 @@
}
-
-
FT_EXPORT_DEF( FT_ULong )
FTC_INode_Weight( FTC_INode inode )
{
- return ftc_inode_weight( FTC_NODE(inode), NULL );
+ return ftc_inode_weight( FTC_NODE( inode ), NULL );
}
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -77,13 +77,11 @@
}
-
-
FT_EXPORT_DEF( void )
FTC_SNode_Free( FTC_SNode snode,
FTC_Cache cache )
{
- ftc_snode_free( FTC_NODE(snode), cache );
+ ftc_snode_free( FTC_NODE( snode ), cache );
}
@@ -267,6 +265,7 @@
FT_UNUSED( cache );
+
FT_ASSERT( snode->count <= FTC_SBIT_ITEMS_PER_NODE );
/* the node itself */
@@ -292,7 +291,7 @@
FT_EXPORT_DEF( FT_ULong )
FTC_SNode_Weight( FTC_SNode snode )
{
- return ftc_snode_weight( FTC_NODE(snode), NULL );
+ return ftc_snode_weight( FTC_NODE( snode ), NULL );
}
@@ -333,14 +332,12 @@
}
-
-
FT_EXPORT_DEF( FT_Bool )
FTC_SNode_Compare( FTC_SNode snode,
FTC_GQuery gquery,
FTC_Cache cache )
{
- return ftc_snode_compare( FTC_NODE(snode), gquery, cache );
+ return ftc_snode_compare( FTC_NODE( snode ), gquery, cache );
}
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -251,7 +251,8 @@
typedef unsigned char Byte, *PByte;
typedef char Bool;
- typedef union
+
+ typedef union Alignment_
{
long l;
void* p;
@@ -259,6 +260,7 @@
} Alignment, *PAlignment;
+
typedef struct TPoint_
{
Long x;
@@ -321,7 +323,7 @@
#define AlignProfileSize \
- ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
+ ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )
#ifdef TT_STATIC_RASTER