diff --git a/ChangeLog b/ChangeLog index 7e5821fe6..55b67b45f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2002-09-09 David Turner + + * src/cache/ftccache.i: fixed a bug that prevented compilation in + debug mode of template instantiation + + * src/cff/cffparse.c: fixed the CFF table loader. It didn't accept + empty arrays, and this prevented the loading of certain fonts. + + * src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.c: adding fix to + prevent seg fault when hints are provided in an empty glyph !! + +2002-09-09 Owen Taylor + + * src/pcf/pcfdriver.c (PCF_Glyph_Load): fixing incorrect computation + of bitmap metrics. + 2002-09-08 David Turner * src/smooth/ftsmooth.c, src/base/ftobjs.c, diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 32f03c018..57581f8ff 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -746,9 +746,9 @@ FT_BEGIN_HEADER /* descender :: The face's descender is the vertical */ /* distance from the baseline to the */ /* bottommost point of any glyph in the face. */ - /* This field's value is positive, expressed */ + /* This field's value is *negative*, expressed */ /* in font units. Some font designs use a */ - /* value different from `-bbox.yMin'. Only */ + /* value different from `bbox.yMin'. Only */ /* relevant for scalable formats. */ /* */ /* height :: The face's height is the vertical distance */ diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h index 099fcd35d..b150e3ce9 100644 --- a/include/freetype/ftimage.h +++ b/include/freetype/ftimage.h @@ -422,25 +422,25 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_NONE */ + /* ft_outline_none */ /* */ /* */ /* This constant is deprecated. Please use @FT_OUTLINE_NONE */ /* instead. */ /* */ -#define zft_outline_none FT_OUTLINE_NONE +#define ft_outline_none FT_OUTLINE_NONE /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_OWNER */ + /* ft_outline_owner */ /* */ /* */ /* This constant is deprecated. Please use @FT_OUTLINE_OWNER */ /* instead. */ /* */ -#define zft_outline_owner FT_OUTLINE_OWNER +#define ft_outline_owner FT_OUTLINE_OWNER /*************************************************************************/ @@ -452,55 +452,55 @@ FT_BEGIN_HEADER /* This constant is deprecated. Please use @FT_OUTLINE_EVEN_ODD_FILL */ /* instead. */ /* */ -#define zft_outline_even_off_fill FT_OUTLINE_EVEN_ODD_FILL +#define ft_outline_even_off_fill FT_OUTLINE_EVEN_ODD_FILL /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_REVERSE_FILL */ + /* ft_outline_reverse_fill */ /* */ /* */ /* This constant is deprecated. Please use @FT_OUTLINE_REVERSE_FILL */ /* instead. */ /* */ -#define zft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL +#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_IGNORE_DROPOUTS */ + /* ft_outline_ignore_dropouts */ /* */ /* */ /* This constant is deprecated. Please use */ /* @FT_OUTLINE_IGNORE_DROPOUTS instead. */ /* */ -#define zft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS +#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_HIGH_PRECISION */ + /* ft_outline_high_precision */ /* */ /* */ /* This constant is deprecated. Please use */ /* @FT_OUTLINE_HIGH_PRECISION instead. */ /* */ -#define zft_outline_high_precision FT_OUTLINE_HIGH_PRECISION +#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_SINGLE_PASS */ + /* ft_outline_single_pass */ /* */ /* */ /* This constant is deprecated. Please use @FT_OUTLINE_SINGLE_PASS */ /* instead. */ /* */ -#define zft_outline_single_pass FT_OUTLINE_SINGLE_PASS +#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS /* */ diff --git a/src/cache/ftccache.i b/src/cache/ftccache.i index 8ecf395df..bb6e631a2 100644 --- a/src/cache/ftccache.i +++ b/src/cache/ftccache.i @@ -89,16 +89,6 @@ bucket = cache->buckets + idx; } -#ifdef FT_DEBUG_LEVEL_ERROR - if ( query->family != family || - family->fam_index >= cache->manager->families.size ) - { - FT_ERROR(( - "ftc_cache_lookup: invalid query (bad 'family' field)\n" )); - return FTC_Err_Invalid_Argument; - } -#endif - pnode = bucket; for ( ;; ) diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index b2c089bcd..43cc55912 100644 --- a/src/cff/cffparse.c +++ b/src/cff/cffparse.c @@ -542,16 +542,15 @@ const CFF_Field_Handler* field; - /* first of all, a trivial check */ - if ( num_args < 1 ) - goto Stack_Underflow; - *parser->top = p; code = v; if ( v == 12 ) { /* two byte operator */ p++; + if ( p >= limit ) + goto Syntax_Error; + code = 0x100 | p[0]; } code = code | parser->object_code; @@ -565,6 +564,11 @@ FT_Byte* q = (FT_Byte*)parser->object + field->offset; + /* check that we have enough arguments -- except for */ + /* delta encoded arrays, which can be empty */ + if ( field->kind != cff_kind_delta && num_args < 1 ) + goto Stack_Underflow; + switch ( field->kind ) { case cff_kind_bool: diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c index cdaadb5ac..74e96ba31 100644 --- a/src/pcf/pcfdriver.c +++ b/src/pcf/pcfdriver.c @@ -414,7 +414,8 @@ THE SOFTWARE. slot->metrics.horiAdvance = metric->characterWidth << 6 ; slot->metrics.horiBearingX = metric->leftSideBearing << 6 ; slot->metrics.horiBearingY = metric->ascent << 6 ; - slot->metrics.width = metric->characterWidth << 6 ; + slot->metrics.width = ( metric->rightSideBearing - + metric->leftSideBearing ) << 6; slot->metrics.height = bitmap->rows << 6; slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c index 372ff287e..c0a9265b6 100644 --- a/src/pshinter/pshalgo2.c +++ b/src/pshinter/pshalgo2.c @@ -1128,7 +1128,7 @@ /* process secondary hints to "selected" points */ - if ( num_masks > 1 ) + if ( num_masks > 1 && glyph->num_points > 0 ) { first = mask->end_point; mask++; diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c index bd65068a6..61745533a 100644 --- a/src/pshinter/pshalgo3.c +++ b/src/pshinter/pshalgo3.c @@ -1297,7 +1297,7 @@ /* process secondary hints to "selected" points */ - if ( num_masks > 1 ) + if ( num_masks > 1 && glyph->num_points > 0 ) { first = mask->end_point; mask++; diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index e982c539b..636d32fa4 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -720,7 +720,7 @@ sbit_metrics->y_scale = 1 << 16; #endif - sbit_metrics->ascender = strike->hori.ascender << 6; + sbit_metrics->ascender = strike->hori.ascender << 6; sbit_metrics->descender = strike->hori.descender << 6; /* XXX: Is this correct? */