* docs/CHANGES: Updated.

Minor clean-ups.
This commit is contained in:
Werner Lemberg 2004-06-12 13:21:20 +00:00
parent 5d95a41229
commit 172522aec7
7 changed files with 102 additions and 68 deletions

View File

@ -1,28 +1,61 @@
2004-06-11 Werner Lemberg <wl@gnu.org>
* docs/CHANGES: Updated.
2004-06-10 David Turner <david@freetype.org>
* 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 <david@freetype.org>
* 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 <wl@gnu.org>
@ -37,6 +70,9 @@
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.

View File

@ -20,11 +20,11 @@ LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
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.

View File

@ -1468,13 +1468,13 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
/* `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'> */
/* for all glyphs do */
/* <compute kern between current and previous glyph and add it to */
/* `origin_x'> */
/* */
/* <load glyph with `FT_Load_Glyph'> */
/* <load glyph with `FT_Load_Glyph'> */
/* */
/* 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; */
/* 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; */
/* */
/* prev_rsb_delta = face->glyph->rsb_delta; */
/* prev_rsb_delta = face->glyph->rsb_delta; */
/* */
/* <save glyph image, or render glyph, or ...> */
/* <save glyph image, or render glyph, or ...> */
/* */
/* origin_x += face->glyph->advance.x; */
/* endfor */
/* } */
/* origin_x += face->glyph->advance.x; */
/* endfor */
/* } */
/* */
typedef struct FT_GlyphSlotRec_
{

20
src/cache/ftcglyph.c vendored
View File

@ -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,14 +134,7 @@
FT_EXPORT_DEF( FT_Error )
FTC_GCache_Init( FTC_GCache cache )
{
return ftc_gcache_init( FTC_CACHE(cache) );
}
FT_EXPORT_DEF( void )
FTC_GCache_Done( FTC_GCache cache )
{
ftc_gcache_done( FTC_CACHE(cache) );
return ftc_gcache_init( FTC_CACHE( cache ) );
}
@ -154,6 +149,13 @@
}
FT_EXPORT_DEF( void )
FTC_GCache_Done( FTC_GCache cache )
{
ftc_gcache_done( FTC_CACHE( cache ) );
}
FT_EXPORT_DEF( FT_Error )
FTC_GCache_New( FTC_Manager manager,
FTC_GCacheClass clazz,

11
src/cache/ftcimage.c vendored
View File

@ -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,7 +106,8 @@
FT_ULong size = 0;
FT_Glyph glyph = inode->glyph;
FT_UNUSED(ftccache);
FT_UNUSED( ftccache );
switch ( glyph->format )
{
@ -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 );
}

11
src/cache/ftcsbits.c vendored
View File

@ -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 );
}

View File

@ -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