Minor fixes.

This commit is contained in:
Werner Lemberg 2000-08-29 18:37:25 +00:00
parent a935908615
commit 740eb33162
2 changed files with 39 additions and 36 deletions

View File

@ -311,7 +311,7 @@
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
LOCAL_FUNC_X LOCAL_FUNC
FT_Error T1_Decoder_Parse_Charstrings( T1_Decoder* decoder, FT_Error T1_Decoder_Parse_Charstrings( T1_Decoder* decoder,
FT_Byte* charstring_base, FT_Byte* charstring_base,
FT_UInt charstring_len ) FT_UInt charstring_len )
@ -1012,7 +1012,7 @@
} }
LOCAL_FUNC_X LOCAL_FUNC
FT_Error T1_Decoder_Init( T1_Decoder* decoder, FT_Error T1_Decoder_Init( T1_Decoder* decoder,
FT_Face face, FT_Face face,
FT_Size size, FT_Size size,
@ -1052,7 +1052,7 @@
} }
LOCAL_FUNC_X LOCAL_FUNC
void T1_Decoder_Done( T1_Decoder* decoder ) void T1_Decoder_Done( T1_Decoder* decoder )
{ {
T1_Builder_Done( &decoder->builder ); T1_Builder_Done( &decoder->builder );

View File

@ -482,32 +482,31 @@
root->units_per_EM = face->header.Units_Per_EM; root->units_per_EM = face->header.Units_Per_EM;
/* XXXXX: Computing the ascender/descender/height is very different */ /* XXX: Computing the ascender/descender/height is very different */
/* from what the specification tells you. Apparently, we must */ /* from what the specification tells you. Apparently, we */
/* be careful because: */ /* must be careful because */
/* */ /* */
/* - not all fonts have an OS/2 table, in this case, we take the */ /* - not all fonts have an OS/2 table; in this case, we take */
/* values in the horizontal header. However, these values */ /* the values in the horizontal header. However, these */
/* very often are not reliable.. */ /* values very often are not reliable. */
/* */ /* */
/* - otherwise, the correctly typographic values are in the */ /* - otherwise, the correct typographic values are in the */
/* sTypoAscender, sTypoDescender & sTypoLineGap fields. */ /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */
/* */ /* */
/* however, certains fonts have these fields set to 0. Rather, */ /* However, certains fonts have these fields set to 0. */
/* they have usWinAscent & usWinDescent correctly set (but with */ /* Rather, they have usWinAscent & usWinDescent correctly */
/* different values). */ /* set (but with different values). */
/* */ /* */
/* As an example, Arial Narrow is implemented through four files */ /* As an example, Arial Narrow is implemented through four */
/* ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */ /* files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */
/* */ /* */
/* Strangely, all fonts have the same values in their sTypoXXX */ /* Strangely, all fonts have the same values in their */
/* fields, except ARIALNB which sets them to 0. */ /* sTypoXXX fields, except ARIALNB which sets them to 0. */
/* */ /* */
/* On the other hand, they all have different usWinAscent/Descent */ /* On the other hand, they all have different */
/* values.. As a conclusion, the OS/2 table cannot be used to */ /* usWinAscent/Descent values -- as a conclusion, the OS/2 */
/* compute the text height reliably !! */ /* table cannot be used to compute the text height reliably! */
/* */ /* */
/* */
/* The ascender/descender/height are computed from the OS/2 table */ /* The ascender/descender/height are computed from the OS/2 table */
/* when found. Otherwise, they're taken from the horizontal */ /* when found. Otherwise, they're taken from the horizontal */
@ -520,26 +519,30 @@
root->height = root->ascender - root->descender + root->height = root->ascender - root->descender +
face->horizontal.Line_Gap; 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 */ /* this computation is based on various versions of Times New Roman */
if (face->horizontal.Line_Gap == 0) if ( face->horizontal.Line_Gap == 0 )
root->height = (root->height*115 + 50)/100; root->height = ( root->height * 115 + 50 ) / 100;
#if 0 #if 0
/* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */ /* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */
/* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */ /* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */
if ( face->os2.version != 0xFFFF && root->ascender ) if ( face->os2.version != 0xFFFF && root->ascender )
{ {
FT_Int height; FT_Int height;
root->ascender = face->os2.sTypoAscender; root->ascender = face->os2.sTypoAscender;
root->descender = -face->os2.sTypoDescender; root->descender = -face->os2.sTypoDescender;
height = root->ascender + root->descender + face->os2.sTypoLineGap; height = root->ascender + root->descender + face->os2.sTypoLineGap;
if (height > root->height) if ( height > root->height )
root->height = height; root->height = height;
} }
#endif
#endif /* 0 */
root->max_advance_width = face->horizontal.advance_Width_Max; root->max_advance_width = face->horizontal.advance_Width_Max;
root->max_advance_height = face->vertical_info root->max_advance_height = face->vertical_info
@ -549,8 +552,8 @@
root->underline_position = face->postscript.underlinePosition; root->underline_position = face->postscript.underlinePosition;
root->underline_thickness = face->postscript.underlineThickness; root->underline_thickness = face->postscript.underlineThickness;
/* root->max_points -- already set up */ /* root->max_points -- already set up */
/* root->max_contours -- already set up */ /* root->max_contours -- already set up */
} }
} }