* src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of

`underline_position'.


* docs/CHANGES: Updated.


Formatting, minor editing.
This commit is contained in:
Werner Lemberg 2008-10-12 11:47:29 +00:00
parent 0192230ea2
commit 174b8de328
5 changed files with 98 additions and 76 deletions

View File

@ -1,3 +1,12 @@
2008-10-12 Graham Asher <graham.asher@btinternet.com>
* src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of
`underline_position'.
2008-10-12 Werner Lemberg <wl@gnu.org>
* docs/CHANGES: Updated.
2008-10-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2008-10-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Fix Savannah bug #24468. Fix Savannah bug #24468.

View File

@ -19,6 +19,18 @@ CHANGES BETWEEN 2.3.8 and 2.3.7
PS Type 1 and CID-keyed PS font drivers; other tables (`ALMX', PS Type 1 and CID-keyed PS font drivers; other tables (`ALMX',
`BBOX', etc.) are not supported yet. `BBOX', etc.) are not supported yet.
- A new interface to extract advance values of glyphs without
loading their outlines has been added. The functions are called
`FT_Get_Advance' and `FT_Get_Advances'; they are defined in file
`ftadvanc.h' (to be accessed as FT_ADVANCES_H).
III. MISCELLANEOUS
- FT_MulFix is now an inlined function; by default, assembler code
is provided for x86 and ARM. See FT_CONFIG_OPTION_INLINE_MULFIX
and FT_CONFIG_OPTION_NO_ASSEMBLER (in ftoption.h) for more.
====================================================================== ======================================================================

View File

@ -883,7 +883,7 @@ FT_BEGIN_HEADER
/* scalable formats. */ /* scalable formats. */
/* */ /* */
/* underline_position :: The position, in font units, of the */ /* underline_position :: The position, in font units, of the */
/* underline line for this face. It's the */ /* underline line for this face. It is the */
/* center of the underlining stem. Only */ /* center of the underlining stem. Only */
/* relevant for scalable formats. */ /* relevant for scalable formats. */
/* */ /* */

View File

@ -388,7 +388,7 @@
#endif /* FT_STATIC_RASTER */ #endif /* FT_STATIC_RASTER */
typedef struct TWorker_ TWorker, *PWorker; typedef struct TWorker_ TWorker, *PWorker;
/* prototypes used for sweep function dispatch */ /* prototypes used for sweep function dispatch */
@ -518,7 +518,7 @@
}; };
typedef struct TRaster_ typedef struct TRaster_
{ {
char* buffer; char* buffer;
long buffer_size; long buffer_size;
@ -531,7 +531,7 @@
#ifdef FT_STATIC_RASTER #ifdef FT_STATIC_RASTER
static TWorker cur_ras; static TWorker cur_ras;
#define ras cur_ras #define ras cur_ras
#else #else
@ -543,24 +543,25 @@
#ifdef FT_RASTER_OPTION_ANTI_ALIASING #ifdef FT_RASTER_OPTION_ANTI_ALIASING
static const char count_table[256] = static const char count_table[256] =
{ {
0 , 1 , 1 , 2 , 1 , 2 , 2 , 3 , 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4, 0 , 1 , 1 , 2 , 1 , 2 , 2 , 3 , 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4,
1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5,
1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5,
2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6,
1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5,
2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, 2 , 3 , 3 , 4 , 3 , 4 ,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 5 , 6 , 5 , 6 , 6 , 7,
3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7,
4 , 5 , 5 , 6 , 5 , 6 , 6 , 7 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8 }; 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8
a };
#endif /* FT_RASTER_OPTION_ANTI_ALIASING */ #endif /* FT_RASTER_OPTION_ANTI_ALIASING */
@ -581,7 +582,7 @@ static const char count_table[256] =
/* Set_High_Precision */ /* Set_High_Precision */
/* */ /* */
/* <Description> */ /* <Description> */
/* Sets precision variables according to param flag. */ /* Set precision variables according to param flag. */
/* */ /* */
/* <Input> */ /* <Input> */
/* High :: Set to True for high precision (typically for ppem < 18), */ /* High :: Set to True for high precision (typically for ppem < 18), */
@ -618,7 +619,7 @@ static const char count_table[256] =
/* New_Profile */ /* New_Profile */
/* */ /* */
/* <Description> */ /* <Description> */
/* Creates a new profile in the render pool. */ /* Create a new profile in the render pool. */
/* */ /* */
/* <Input> */ /* <Input> */
/* aState :: The state/orientation of the new profile. */ /* aState :: The state/orientation of the new profile. */
@ -684,7 +685,7 @@ static const char count_table[256] =
/* End_Profile */ /* End_Profile */
/* */ /* */
/* <Description> */ /* <Description> */
/* Finalizes the current profile. */ /* Finalize the current profile. */
/* */ /* */
/* <Return> */ /* <Return> */
/* SUCCESS on success. FAILURE in case of overflow or incoherency. */ /* SUCCESS on success. FAILURE in case of overflow or incoherency. */
@ -741,7 +742,7 @@ static const char count_table[256] =
/* Insert_Y_Turn */ /* Insert_Y_Turn */
/* */ /* */
/* <Description> */ /* <Description> */
/* Inserts a salient into the sorted list placed on top of the render */ /* Insert a salient into the sorted list placed on top of the render */
/* pool. */ /* pool. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -796,7 +797,7 @@ static const char count_table[256] =
/* Finalize_Profile_Table */ /* Finalize_Profile_Table */
/* */ /* */
/* <Description> */ /* <Description> */
/* Adjusts all links in the profiles list. */ /* Adjust all links in the profiles list. */
/* */ /* */
/* <Return> */ /* <Return> */
/* SUCCESS on success. FAILURE in case of overflow. */ /* SUCCESS on success. FAILURE in case of overflow. */
@ -857,7 +858,7 @@ static const char count_table[256] =
/* Split_Conic */ /* Split_Conic */
/* */ /* */
/* <Description> */ /* <Description> */
/* Subdivides one conic Bezier into two joint sub-arcs in the Bezier */ /* Subdivide one conic Bezier into two joint sub-arcs in the Bezier */
/* stack. */ /* stack. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -896,7 +897,7 @@ static const char count_table[256] =
/* Split_Cubic */ /* Split_Cubic */
/* */ /* */
/* <Description> */ /* <Description> */
/* Subdivides a third-order Bezier arc into two joint sub-arcs in the */ /* Subdivide a third-order Bezier arc into two joint sub-arcs in the */
/* Bezier stack. */ /* Bezier stack. */
/* */ /* */
/* <Note> */ /* <Note> */
@ -938,7 +939,7 @@ static const char count_table[256] =
/* Line_Up */ /* Line_Up */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the x-coordinates of an ascending line segment and stores */ /* Compute the x-coordinates of an ascending line segment and store */
/* them in the render pool. */ /* them in the render pool. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -1077,8 +1078,8 @@ static const char count_table[256] =
/* Line_Down */ /* Line_Down */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the x-coordinates of an descending line segment and */ /* Compute the x-coordinates of an descending line segment and store */
/* stores them in the render pool. */ /* them in the render pool. */
/* */ /* */
/* <Input> */ /* <Input> */
/* x1 :: The x-coordinate of the segment's start point. */ /* x1 :: The x-coordinate of the segment's start point. */
@ -1128,7 +1129,7 @@ static const char count_table[256] =
/* Bezier_Up */ /* Bezier_Up */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the x-coordinates of an ascending Bezier arc and stores */ /* Compute the x-coordinates of an ascending Bezier arc and store */
/* them in the render pool. */ /* them in the render pool. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -1261,7 +1262,7 @@ static const char count_table[256] =
/* Bezier_Down */ /* Bezier_Down */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the x-coordinates of an descending Bezier arc and stores */ /* Compute the x-coordinates of an descending Bezier arc and store */
/* them in the render pool. */ /* them in the render pool. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -1310,7 +1311,7 @@ static const char count_table[256] =
/* Line_To */ /* Line_To */
/* */ /* */
/* <Description> */ /* <Description> */
/* Injects a new line segment and adjusts Profiles list. */ /* Inject a new line segment and adjust the Profiles list. */
/* */ /* */
/* <Input> */ /* <Input> */
/* x :: The x-coordinate of the segment's end point (its start point */ /* x :: The x-coordinate of the segment's end point (its start point */
@ -1400,7 +1401,7 @@ static const char count_table[256] =
/* Conic_To */ /* Conic_To */
/* */ /* */
/* <Description> */ /* <Description> */
/* Injects a new conic arc and adjusts the profile list. */ /* Inject a new conic arc and adjust the profile list. */
/* */ /* */
/* <Input> */ /* <Input> */
/* cx :: The x-coordinate of the arc's new control point. */ /* cx :: The x-coordinate of the arc's new control point. */
@ -1510,7 +1511,7 @@ static const char count_table[256] =
/* Cubic_To */ /* Cubic_To */
/* */ /* */
/* <Description> */ /* <Description> */
/* Injects a new cubic arc and adjusts the profile list. */ /* Inject a new cubic arc and adjust the profile list. */
/* */ /* */
/* <Input> */ /* <Input> */
/* cx1 :: The x-coordinate of the arc's first new control point. */ /* cx1 :: The x-coordinate of the arc's first new control point. */
@ -1648,7 +1649,7 @@ static const char count_table[256] =
/* Decompose_Curve */ /* Decompose_Curve */
/* */ /* */
/* <Description> */ /* <Description> */
/* Scans the outline arrays in order to emit individual segments and */ /* Scan the outline arrays in order to emit individual segments and */
/* Beziers by calling Line_To() and Bezier_To(). It handles all */ /* Beziers by calling Line_To() and Bezier_To(). It handles all */
/* weird cases, like when the first point is off the curve, or when */ /* weird cases, like when the first point is off the curve, or when */
/* there are simply no `on' points in the contour! */ /* there are simply no `on' points in the contour! */
@ -1869,7 +1870,7 @@ static const char count_table[256] =
/* Convert_Glyph */ /* Convert_Glyph */
/* */ /* */
/* <Description> */ /* <Description> */
/* Converts a glyph into a series of segments and arcs and makes a */ /* Convert a glyph into a series of segments and arcs and make a */
/* profiles list with them. */ /* profiles list with them. */
/* */ /* */
/* <Input> */ /* <Input> */
@ -2557,10 +2558,10 @@ static const char count_table[256] =
if ( ras.gray_max_x >= 0 ) if ( ras.gray_max_x >= 0 )
{ {
Long last_pixel = ras.target.width - 1; Long last_pixel = ras.target.width - 1;
Int last_cell = last_pixel >> 2; Int last_cell = last_pixel >> 2;
Int last_bit = last_pixel & 3; Int last_bit = last_pixel & 3;
Bool over = 0; Bool over = 0;
if ( ras.gray_max_x >= last_cell && last_bit != 3 ) if ( ras.gray_max_x >= last_cell && last_bit != 3 )
@ -2572,8 +2573,8 @@ static const char count_table[256] =
if ( ras.gray_min_x < 0 ) if ( ras.gray_min_x < 0 )
ras.gray_min_x = 0; ras.gray_min_x = 0;
bit = ras.bTarget + ras.gray_min_x; bit = ras.bTarget + ras.gray_min_x;
bit2 = bit + ras.gray_width; bit2 = bit + ras.gray_width;
c1 = ras.gray_max_x - ras.gray_min_x; c1 = ras.gray_max_x - ras.gray_min_x;
@ -2748,7 +2749,7 @@ static const char count_table[256] =
TProfileList draw_left, draw_right; TProfileList draw_left, draw_right;
/* Init empty linked lists */ /* initialize empty linked lists */
Init_Linked( &waiting ); Init_Linked( &waiting );
@ -2779,18 +2780,18 @@ static const char count_table[256] =
P = Q; P = Q;
} }
/* Check the Y-turns */ /* check the Y-turns */
if ( ras.numTurns == 0 ) if ( ras.numTurns == 0 )
{ {
ras.error = Raster_Err_Invalid; ras.error = Raster_Err_Invalid;
return FAILURE; return FAILURE;
} }
/* Now inits the sweep */ /* now initialize the sweep */
ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y ); ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y );
/* Then compute the distance of each profile from min_Y */ /* then compute the distance of each profile from min_Y */
P = waiting; P = waiting;
@ -2800,7 +2801,7 @@ static const char count_table[256] =
P = P->link; P = P->link;
} }
/* Let's go */ /* let's go */
y = min_Y; y = min_Y;
y_height = 0; y_height = 0;
@ -2811,7 +2812,7 @@ static const char count_table[256] =
while ( ras.numTurns > 0 ) while ( ras.numTurns > 0 )
{ {
/* look in the waiting list for new activations */ /* check waiting list for new activations */
P = waiting; P = waiting;
@ -2838,7 +2839,7 @@ static const char count_table[256] =
P = Q; P = Q;
} }
/* Sort the drawing lists */ /* sort the drawing lists */
Sort( &draw_left ); Sort( &draw_left );
Sort( &draw_right ); Sort( &draw_right );
@ -2848,7 +2849,7 @@ static const char count_table[256] =
while ( y < y_change ) while ( y < y_change )
{ {
/* Let's trace */ /* let's trace */
dropouts = 0; dropouts = 0;
@ -2877,7 +2878,7 @@ static const char count_table[256] =
{ {
if ( ras.dropOutControl != 2 ) if ( ras.dropOutControl != 2 )
{ {
/* a drop out was detected */ /* a drop-out was detected */
P_Left ->X = x1; P_Left ->X = x1;
P_Right->X = x2; P_Right->X = x2;
@ -2899,9 +2900,9 @@ static const char count_table[256] =
P_Right = P_Right->link; P_Right = P_Right->link;
} }
/* now perform the dropouts _after_ the span drawing -- */ /* handle drop-outs _after_ the span drawing -- */
/* drop-outs processing has been moved out of the loop */ /* drop-out processing has been moved out of the loop */
/* for performance tuning */ /* for performance tuning */
if ( dropouts > 0 ) if ( dropouts > 0 )
goto Scan_DropOuts; goto Scan_DropOuts;
@ -2918,7 +2919,7 @@ static const char count_table[256] =
} }
} }
/* Now finalize the profiles that needs it */ /* now finalize the profiles that need it */
P = draw_left; P = draw_left;
while ( P ) while ( P )
@ -2939,7 +2940,7 @@ static const char count_table[256] =
} }
} }
/* for gray-scaling, flushes the bitmap scanline cache */ /* for gray-scaling, flush the bitmap scanline cache */
while ( y <= max_Y ) while ( y <= max_Y )
{ {
ras.Proc_Sweep_Step( RAS_VAR ); ras.Proc_Sweep_Step( RAS_VAR );
@ -2982,7 +2983,7 @@ static const char count_table[256] =
/* Render_Single_Pass */ /* Render_Single_Pass */
/* */ /* */
/* <Description> */ /* <Description> */
/* Performs one sweep with sub-banding. */ /* Perform one sweep with sub-banding. */
/* */ /* */
/* <Input> */ /* <Input> */
/* flipped :: If set, flip the direction of the outline. */ /* flipped :: If set, flip the direction of the outline. */
@ -3057,7 +3058,7 @@ static const char count_table[256] =
/* Render_Glyph */ /* Render_Glyph */
/* */ /* */
/* <Description> */ /* <Description> */
/* Renders a glyph in a bitmap. Sub-banding if needed. */ /* Render a glyph in a bitmap. Sub-banding if needed. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
@ -3126,14 +3127,13 @@ static const char count_table[256] =
#ifdef FT_RASTER_OPTION_ANTI_ALIASING #ifdef FT_RASTER_OPTION_ANTI_ALIASING
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* Render_Gray_Glyph */ /* Render_Gray_Glyph */
/* */ /* */
/* <Description> */ /* <Description> */
/* Renders a glyph with grayscaling. Sub-banding if needed. */ /* Render a glyph with grayscaling. Sub-banding if needed. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
@ -3249,7 +3249,7 @@ static const char count_table[256] =
static int static int
ft_black_new( void* memory, ft_black_new( void* memory,
FT_Raster *araster ) FT_Raster *araster )
{ {
static TRaster the_raster; static TRaster the_raster;
@ -3307,9 +3307,9 @@ static const char count_table[256] =
static void static void
ft_black_reset( PRaster raster, ft_black_reset( PRaster raster,
char* pool_base, char* pool_base,
long pool_size ) long pool_size )
{ {
if ( raster ) if ( raster )
{ {
@ -3334,9 +3334,9 @@ static const char count_table[256] =
static void static void
ft_black_set_mode( PRaster raster, ft_black_set_mode( PRaster raster,
unsigned long mode, unsigned long mode,
const char* palette ) const char* palette )
{ {
#ifdef FT_RASTER_OPTION_ANTI_ALIASING #ifdef FT_RASTER_OPTION_ANTI_ALIASING

View File

@ -947,13 +947,14 @@
#endif /* 0 */ #endif /* 0 */
root->max_advance_width = face->horizontal.advance_Width_Max; root->max_advance_width = face->horizontal.advance_Width_Max;
root->max_advance_height = (FT_Short)( face->vertical_info
? face->vertical.advance_Height_Max
: root->height );
root->max_advance_height = (FT_Short)( face->vertical_info /* see http://www.microsoft.com/OpenType/OTSpec/post.htm */
? face->vertical.advance_Height_Max root->underline_position = face->postscript.underlinePosition -
: root->height ); face->postscript.underlineThickness / 2;
root->underline_position = face->postscript.underlinePosition;
root->underline_thickness = face->postscript.underlineThickness; root->underline_thickness = face->postscript.underlineThickness;
} }