From 8530a228889128adfd446514928f36663ed20f04 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 9 Jun 2004 20:18:35 +0000 Subject: [PATCH] * 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 !! * src/sfnt/sfobjs.c: removing compiler warning --- ChangeLog | 13 +++++-- include/freetype/freetype.h | 77 +++++++++++++++++++------------------ src/autofit/afdummy.c | 1 + src/autofit/afloader.c | 4 +- src/autohint/ahhint.c | 4 +- src/raster/ftraster.c | 10 ++++- src/sfnt/sfobjs.c | 2 +- 7 files changed, 64 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72eafd51e..f380e7040 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-06-08 David Turner + + * 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 !! + + * src/sfnt/sfobjs.c: removing compiler warning + 2004-06-05 Werner Lemberg * src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and @@ -11,9 +21,6 @@ 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. diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 453db7454..3e3d21777 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -213,41 +213,6 @@ FT_BEGIN_HEADER /* vertAdvance :: */ /* Advance height for vertical layout. */ /* */ - /* 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. */ - /* */ - /* */ - /* 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 */ - /* */ - /* */ - /* */ - /* */ - /* if ( prev_rsb_delta - face->glyph->metrics.lsb_delta >= 32 ) */ - /* origin_x -= 64; */ - /* else if */ - /* ( prev_rsb_delta - face->glyph->metrics.lsb_delta < -32 ) */ - /* origin_x += 64; */ - /* */ - /* prev_rsb_delta = face->glyph->metrics.rsb_delta; */ - /* */ - /* */ - /* */ - /* origin_x += face->glyph->advance.x; */ - /* endfor */ - /* */ typedef struct FT_Glyph_Metrics_ { FT_Pos width; @@ -261,9 +226,6 @@ FT_BEGIN_HEADER FT_Pos vertBearingY; FT_Pos vertAdvance; - FT_Pos lsb_delta; - FT_Pos rsb_delta; - } FT_Glyph_Metrics; @@ -1506,6 +1468,14 @@ 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. */ + /* */ + /* rsb_delta :: */ + /* The difference between hinted and unhinted right side bearing */ + /* while autohinting is active. Zero otherwise. */ + /* */ /* */ /* If @FT_Load_Glyph is called with default flags (see */ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ @@ -1525,6 +1495,34 @@ FT_BEGIN_HEADER /* position (e.g. coordinates [0,0] on the baseline). Of course, */ /* `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' . */ /* */ + /* */ + /* 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 */ + /* */ + /* */ + /* */ + /* */ + /* 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; */ + /* */ + /* */ + /* */ + /* origin_x += face->glyph->advance.x; */ + /* endfor */ + /* } */ + /* */ typedef struct FT_GlyphSlotRec_ { FT_Library library; @@ -1552,6 +1550,9 @@ FT_BEGIN_HEADER void* control_data; long control_len; + FT_Pos lsb_delta; + FT_Pos rsb_delta; + void* other; FT_Slot_Internal internal; diff --git a/src/autofit/afdummy.c b/src/autofit/afdummy.c index 3a13140d9..2d5f89839 100644 --- a/src/autofit/afdummy.c +++ b/src/autofit/afdummy.c @@ -1,4 +1,5 @@ #include "afdummy.h" +#include "afhints.h" static FT_Error diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c index bd3a2c0b2..6782ee8de 100644 --- a/src/autofit/afloader.c +++ b/src/autofit/afloader.c @@ -190,8 +190,8 @@ loader->pp1.x = FT_PIX_ROUND( pp1x_uh ); loader->pp2.x = FT_PIX_ROUND( pp2x_uh ); - slot->metrics.lsb_delta = hinter->pp1.x - pp1x_uh; - slot->metrics.rsb_delta = hinter->pp2.x - pp2x_uh; + slot->lsb_delta = loader->pp1.x - pp1x_uh; + slot->rsb_delta = loader->pp2.x - pp2x_uh; #if 0 /* try to fix certain bad advance computations */ diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c index c9e4dbb35..8e8afeac4 100644 --- a/src/autohint/ahhint.c +++ b/src/autohint/ahhint.c @@ -1569,8 +1569,8 @@ hinter->pp1.x = FT_PIX_ROUND( pp1x_uh ); hinter->pp2.x = FT_PIX_ROUND( pp2x_uh ); - slot->metrics.lsb_delta = hinter->pp1.x - pp1x_uh; - slot->metrics.rsb_delta = hinter->pp2.x - pp2x_uh; + slot->lsb_delta = hinter->pp1.x - pp1x_uh; + slot->rsb_delta = hinter->pp2.x - pp2x_uh; #if 0 /* try to fix certain bad advance computations */ diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index 757cba758..620b3d71e 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -251,6 +251,14 @@ typedef unsigned char Byte, *PByte; typedef char Bool; + typedef union + { + long l; + void* p; + void (*f)(void); + + } Alignment, *PAlignment; + typedef struct TPoint_ { Long x; @@ -313,7 +321,7 @@ #define AlignProfileSize \ - ( ( sizeof ( TProfile ) + sizeof ( long ) - 1 ) / sizeof ( long ) ) + ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) ) #ifdef TT_STATIC_RASTER diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 31281df0a..37b58a304 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -160,7 +160,7 @@ FT_Int found_win = -1; FT_Int found_unicode = -1; - FT_Bool is_english; + FT_Bool is_english = 0; TT_NameEntry_ConvertFunc convert;