|
|
|
@ -2204,12 +2204,7 @@ |
|
|
|
|
|
|
|
|
|
FT_BBox bbox; |
|
|
|
|
FT_Fixed y_scale; |
|
|
|
|
|
|
|
|
|
/* TODO: (OT-SVG) Temporary hack to accomodate the change
|
|
|
|
|
* in the `TT_GlyphSlot' made. Rewrite properly |
|
|
|
|
*/ |
|
|
|
|
TT_GlyphSlot glyph_ = (TT_GlyphSlot)loader->glyph; |
|
|
|
|
FT_GlyphSlot glyph = (FT_GlyphSlot)glyph_; |
|
|
|
|
TT_GlyphSlot glyph = loader->glyph; |
|
|
|
|
TT_Size size = loader->size; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2396,10 +2391,8 @@ |
|
|
|
|
FT_Error error; |
|
|
|
|
TT_SBit_MetricsRec sbit_metrics; |
|
|
|
|
|
|
|
|
|
/* (OT-SVG) face assignment changed to accomodate the change in
|
|
|
|
|
* the structure of TT_GlyphSlot |
|
|
|
|
*/ |
|
|
|
|
face = (TT_Face)(glyph->root.face); |
|
|
|
|
|
|
|
|
|
face = (TT_Face)glyph->face; |
|
|
|
|
sfnt = (SFNT_Service)face->sfnt; |
|
|
|
|
stream = face->root.stream; |
|
|
|
|
|
|
|
|
@ -2408,39 +2401,35 @@ |
|
|
|
|
glyph_index, |
|
|
|
|
(FT_UInt)load_flags, |
|
|
|
|
stream, |
|
|
|
|
&(glyph->root.bitmap), |
|
|
|
|
&glyph->bitmap, |
|
|
|
|
&sbit_metrics ); |
|
|
|
|
/* TODO: (OT-SVG) So many `glyph->root' look ugly. Maybe create a new variable
|
|
|
|
|
* to make this look good. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
if ( !error ) |
|
|
|
|
{ |
|
|
|
|
(glyph->root).outline.n_points = 0; |
|
|
|
|
(glyph->root).outline.n_contours = 0; |
|
|
|
|
glyph->outline.n_points = 0; |
|
|
|
|
glyph->outline.n_contours = 0; |
|
|
|
|
|
|
|
|
|
(glyph->root).metrics.width = (FT_Pos)sbit_metrics.width * 64; |
|
|
|
|
(glyph->root).metrics.height = (FT_Pos)sbit_metrics.height * 64; |
|
|
|
|
glyph->metrics.width = (FT_Pos)sbit_metrics.width * 64; |
|
|
|
|
glyph->metrics.height = (FT_Pos)sbit_metrics.height * 64; |
|
|
|
|
|
|
|
|
|
(glyph->root).metrics.horiBearingX = (FT_Pos)sbit_metrics.horiBearingX * 64; |
|
|
|
|
(glyph->root).metrics.horiBearingY = (FT_Pos)sbit_metrics.horiBearingY * 64; |
|
|
|
|
(glyph->root).metrics.horiAdvance = (FT_Pos)sbit_metrics.horiAdvance * 64; |
|
|
|
|
glyph->metrics.horiBearingX = (FT_Pos)sbit_metrics.horiBearingX * 64; |
|
|
|
|
glyph->metrics.horiBearingY = (FT_Pos)sbit_metrics.horiBearingY * 64; |
|
|
|
|
glyph->metrics.horiAdvance = (FT_Pos)sbit_metrics.horiAdvance * 64; |
|
|
|
|
|
|
|
|
|
(glyph->root).metrics.vertBearingX = (FT_Pos)sbit_metrics.vertBearingX * 64; |
|
|
|
|
(glyph->root).metrics.vertBearingY = (FT_Pos)sbit_metrics.vertBearingY * 64; |
|
|
|
|
(glyph->root).metrics.vertAdvance = (FT_Pos)sbit_metrics.vertAdvance * 64; |
|
|
|
|
glyph->metrics.vertBearingX = (FT_Pos)sbit_metrics.vertBearingX * 64; |
|
|
|
|
glyph->metrics.vertBearingY = (FT_Pos)sbit_metrics.vertBearingY * 64; |
|
|
|
|
glyph->metrics.vertAdvance = (FT_Pos)sbit_metrics.vertAdvance * 64; |
|
|
|
|
|
|
|
|
|
(glyph->root).format = FT_GLYPH_FORMAT_BITMAP; |
|
|
|
|
glyph->format = FT_GLYPH_FORMAT_BITMAP; |
|
|
|
|
|
|
|
|
|
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) |
|
|
|
|
{ |
|
|
|
|
(glyph->root).bitmap_left = sbit_metrics.vertBearingX; |
|
|
|
|
(glyph->root).bitmap_top = sbit_metrics.vertBearingY; |
|
|
|
|
glyph->bitmap_left = sbit_metrics.vertBearingX; |
|
|
|
|
glyph->bitmap_top = sbit_metrics.vertBearingY; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
(glyph->root).bitmap_left = sbit_metrics.horiBearingX; |
|
|
|
|
(glyph->root).bitmap_top = sbit_metrics.horiBearingY; |
|
|
|
|
glyph->bitmap_left = sbit_metrics.horiBearingX; |
|
|
|
|
glyph->bitmap_top = sbit_metrics.horiBearingY; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2449,6 +2438,7 @@ |
|
|
|
|
|
|
|
|
|
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error |
|
|
|
|
tt_loader_init( TT_Loader loader, |
|
|
|
|
TT_Size size, |
|
|
|
@ -2464,12 +2454,12 @@ |
|
|
|
|
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); |
|
|
|
|
#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \ |
|
|
|
|
defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL |
|
|
|
|
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( (TT_Face)(glyph->root).face ); |
|
|
|
|
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( (TT_Face)glyph->face ); |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
face = (TT_Face)(glyph->root.face); |
|
|
|
|
face = (TT_Face)glyph->face; |
|
|
|
|
stream = face->root.stream; |
|
|
|
|
|
|
|
|
|
FT_ZERO( loader ); |
|
|
|
@ -2721,7 +2711,7 @@ |
|
|
|
|
/* get face's glyph loader */ |
|
|
|
|
if ( !glyf_table_only ) |
|
|
|
|
{ |
|
|
|
|
FT_GlyphLoader gloader = (glyph->root).internal->loader; |
|
|
|
|
FT_GlyphLoader gloader = glyph->internal->loader; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FT_GlyphLoader_Rewind( gloader ); |
|
|
|
@ -2785,7 +2775,7 @@ |
|
|
|
|
*/ |
|
|
|
|
FT_LOCAL_DEF( FT_Error ) |
|
|
|
|
TT_Load_Glyph( TT_Size size, |
|
|
|
|
TT_GlyphSlot glyph_, |
|
|
|
|
TT_GlyphSlot glyph, |
|
|
|
|
FT_UInt glyph_index, |
|
|
|
|
FT_Int32 load_flags ) |
|
|
|
|
{ |
|
|
|
@ -2793,9 +2783,6 @@ |
|
|
|
|
TT_LoaderRec loader; |
|
|
|
|
SFNT_Service sfnt; |
|
|
|
|
|
|
|
|
|
/* TODO: (OT-SVG) maybe find a proper way to do this */ |
|
|
|
|
FT_GlyphSlot glyph = (FT_GlyphSlot)glyph_; |
|
|
|
|
|
|
|
|
|
FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index )); |
|
|
|
|
|
|
|
|
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS |
|
|
|
@ -2809,7 +2796,7 @@ |
|
|
|
|
FT_Fixed y_scale = size->root.metrics.y_scale; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error = load_sbit_image( size, glyph_, glyph_index, load_flags ); |
|
|
|
|
error = load_sbit_image( size, glyph, glyph_index, load_flags ); |
|
|
|
|
if ( FT_ERR_EQ( error, Missing_Bitmap ) ) |
|
|
|
|
{ |
|
|
|
|
/* the bitmap strike is incomplete and misses the requested glyph; */ |
|
|
|
@ -2876,7 +2863,7 @@ |
|
|
|
|
if ( FT_IS_SCALABLE( glyph->face ) ) |
|
|
|
|
{ |
|
|
|
|
/* for the bbox we need the header only */ |
|
|
|
|
(void)tt_loader_init( &loader, size, glyph_, load_flags, TRUE ); |
|
|
|
|
(void)tt_loader_init( &loader, size, glyph, load_flags, TRUE ); |
|
|
|
|
(void)load_truetype_glyph( &loader, glyph_index, 0, TRUE ); |
|
|
|
|
tt_loader_done( &loader ); |
|
|
|
|
glyph->linearHoriAdvance = loader.linear; |
|
|
|
@ -2898,6 +2885,13 @@ |
|
|
|
|
|
|
|
|
|
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ |
|
|
|
|
|
|
|
|
|
/* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */ |
|
|
|
|
if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid ) |
|
|
|
|
{ |
|
|
|
|
error = FT_THROW( Invalid_Size_Handle ); |
|
|
|
|
goto Exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* check for OT-SVG */ |
|
|
|
|
if ( ( load_flags & FT_LOAD_COLOR ) && ( ((TT_Face)glyph->face)->svg ) ) |
|
|
|
|
{ |
|
|
|
@ -2916,7 +2910,7 @@ |
|
|
|
|
goto Exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
error = tt_loader_init( &loader, size, glyph_, load_flags, FALSE ); |
|
|
|
|
error = tt_loader_init( &loader, size, glyph, load_flags, FALSE ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit; |
|
|
|
|
|
|
|
|
|