From 4a5c142a4047d0dc567d94e7cd9b9cb3f1f2b5fe Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 29 Aug 2000 18:37:25 +0000 Subject: [PATCH] Minor fixes. --- src/psaux/t1decode.c | 6 ++-- src/sfnt/sfobjs.c | 69 +++++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index 49060ba7f..eb0333986 100644 --- a/src/psaux/t1decode.c +++ b/src/psaux/t1decode.c @@ -311,7 +311,7 @@ /* */ /* FreeType error code. 0 means success. */ /* */ - LOCAL_FUNC_X + LOCAL_FUNC FT_Error T1_Decoder_Parse_Charstrings( T1_Decoder* decoder, FT_Byte* charstring_base, FT_UInt charstring_len ) @@ -1012,7 +1012,7 @@ } - LOCAL_FUNC_X + LOCAL_FUNC FT_Error T1_Decoder_Init( T1_Decoder* decoder, FT_Face face, FT_Size size, @@ -1052,7 +1052,7 @@ } - LOCAL_FUNC_X + LOCAL_FUNC void T1_Decoder_Done( T1_Decoder* decoder ) { T1_Builder_Done( &decoder->builder ); diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index f36a746a7..b37bbac65 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -482,32 +482,31 @@ root->units_per_EM = face->header.Units_Per_EM; - /* XXXXX: Computing the ascender/descender/height is very different */ - /* from what the specification tells you. Apparently, we must */ - /* be careful because: */ - /* */ - /* - not all fonts have an OS/2 table, in this case, we take the */ - /* values in the horizontal header. However, these values */ - /* very often are not reliable.. */ - /* */ - /* - otherwise, the correctly typographic values are in the */ - /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */ - /* */ - /* however, certains fonts have these fields set to 0. Rather, */ - /* they have usWinAscent & usWinDescent correctly set (but with */ - /* different values). */ - /* */ - /* As an example, Arial Narrow is implemented through four files */ - /* ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */ - /* */ - /* Strangely, all fonts have the same values in their sTypoXXX */ - /* fields, except ARIALNB which sets them to 0. */ - /* */ - /* On the other hand, they all have different usWinAscent/Descent */ - /* values.. As a conclusion, the OS/2 table cannot be used to */ - /* compute the text height reliably !! */ - /* */ - /* */ + /* XXX: Computing the ascender/descender/height is very different */ + /* from what the specification tells you. Apparently, we */ + /* must be careful because */ + /* */ + /* - not all fonts have an OS/2 table; in this case, we take */ + /* the values in the horizontal header. However, these */ + /* values very often are not reliable. */ + /* */ + /* - otherwise, the correct typographic values are in the */ + /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */ + /* */ + /* However, certains fonts have these fields set to 0. */ + /* Rather, they have usWinAscent & usWinDescent correctly */ + /* set (but with different values). */ + /* */ + /* As an example, Arial Narrow is implemented through four */ + /* files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */ + /* */ + /* Strangely, all fonts have the same values in their */ + /* sTypoXXX fields, except ARIALNB which sets them to 0. */ + /* */ + /* On the other hand, they all have different */ + /* usWinAscent/Descent values -- as a conclusion, the OS/2 */ + /* table cannot be used to compute the text height reliably! */ + /* */ /* The ascender/descender/height are computed from the OS/2 table */ /* when found. Otherwise, they're taken from the horizontal */ @@ -520,26 +519,30 @@ root->height = root->ascender - root->descender + face->horizontal.Line_Gap; - /* when the line_gap is 0, we add an extra 15 % to the text height */ + /* if the line_gap is 0, we add an extra 15% to the text height -- */ /* this computation is based on various versions of Times New Roman */ - if (face->horizontal.Line_Gap == 0) - root->height = (root->height*115 + 50)/100; + if ( face->horizontal.Line_Gap == 0 ) + root->height = ( root->height * 115 + 50 ) / 100; #if 0 + /* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */ /* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */ if ( face->os2.version != 0xFFFF && root->ascender ) { FT_Int height; + root->ascender = face->os2.sTypoAscender; root->descender = -face->os2.sTypoDescender; height = root->ascender + root->descender + face->os2.sTypoLineGap; - if (height > root->height) + if ( height > root->height ) root->height = height; } -#endif + +#endif /* 0 */ + root->max_advance_width = face->horizontal.advance_Width_Max; root->max_advance_height = face->vertical_info @@ -549,8 +552,8 @@ root->underline_position = face->postscript.underlinePosition; root->underline_thickness = face->postscript.underlineThickness; - /* root->max_points -- already set up */ - /* root->max_contours -- already set up */ + /* root->max_points -- already set up */ + /* root->max_contours -- already set up */ } }