[sfnt] `sbix' fix-ups.

* src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps
are rendered scaled and then the `glyf' outline rendered on top.  We
don't support that yet, so just ignore the `glyf' outline and
advertise it as a bitmap-only font.

* src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
[TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units.
(tt_face_load_sbix_image): Typo.
This commit is contained in:
Behdad Esfahbod 2013-07-19 14:28:28 +02:00 committed by Werner Lemberg
parent 01705395b0
commit 778a7e6a36
3 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,16 @@
2013-07-18 Behdad Esfahbod <behdad@google.com>
[sfnt] `sbix' fix-ups.
* src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps
are rendered scaled and then the `glyf' outline rendered on top. We
don't support that yet, so just ignore the `glyf' outline and
advertise it as a bitmap-only font.
* src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
[TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units.
(tt_face_load_sbix_image): Typo.
2013-07-18 Behdad Esfahbod <behdad@google.com>
[sfnt] Add support for Apple's `sbix' color bitmap table.

View File

@ -555,6 +555,7 @@
#endif
FT_Bool has_outline;
FT_Bool is_apple_sbit;
FT_Bool is_apple_sbix;
FT_Bool ignore_preferred_family = FALSE;
FT_Bool ignore_preferred_subfamily = FALSE;
@ -608,6 +609,14 @@
#endif
is_apple_sbit = 0;
is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
/* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf'
* outline rendered on top. We don't support that yet, so just ignore
* the 'glyf' outline and advertise it as a bitmap-only font. */
if ( is_apple_sbix )
has_outline = FALSE;
/* if this font doesn't contain outlines, we try to load */
/* a `bhed' table */
@ -619,7 +628,7 @@
/* load the font header (`head' table) if this isn't an Apple */
/* sbit font file */
if ( !is_apple_sbit )
if ( !is_apple_sbit || is_apple_sbix )
{
LOAD_( head );
if ( error )

View File

@ -286,12 +286,12 @@
metrics->x_ppem = ppem;
metrics->y_ppem = ppem;
metrics->ascender = ppem * hori->Ascender / upem;
metrics->descender = ppem * hori->Descender / upem;
metrics->ascender = ppem * hori->Ascender * 64 / upem;
metrics->descender = ppem * hori->Descender * 64 / upem;
metrics->height = ppem * ( hori->Ascender -
hori->Descender +
hori->Line_Gap ) / upem;
metrics->max_advance = ppem * hori->advance_Width_Max / upem;
hori->Line_Gap ) * 64 / upem;
metrics->max_advance = ppem * hori->advance_Width_Max * 64 / upem;
return error;
}
@ -1322,7 +1322,7 @@
metrics->horiBearingX = originOffsetX;
metrics->horiBearingY = -originOffsetY + metrics->height;
metrics->horiAdvance = aadvance * face->root.size->metrics.x_ppem /
face->root.units_per_EM;
face->header.Units_Per_EM;
}
return error;