[truetype] Improve handling of buggy embedded bitmap strikes.
We are now able to successfully load `AppleMyoungJo.ttf'. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph format.
This commit is contained in:
parent
2862686996
commit
427b176893
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2013-11-21 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[truetype] Improve handling of buggy embedded bitmap strikes.
|
||||||
|
|
||||||
|
We are now able to successfully load `AppleMyoungJo.ttf'.
|
||||||
|
Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
|
||||||
|
|
||||||
|
* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph
|
||||||
|
format.
|
||||||
|
|
||||||
2013-11-20 Werner Lemberg <wl@gnu.org>
|
2013-11-20 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[truetype] Don't trust `maxp's `maxSizeOfInstructions'.
|
[truetype] Don't trust `maxp's `maxSizeOfInstructions'.
|
||||||
|
|
|
@ -969,7 +969,22 @@
|
||||||
case 2:
|
case 2:
|
||||||
case 5:
|
case 5:
|
||||||
case 7:
|
case 7:
|
||||||
|
{
|
||||||
|
/* Don't trust `glyph_format'. For example, Apple's main Korean */
|
||||||
|
/* system font, `AppleMyungJo.ttf' (version 7.0d2e6), uses glyph */
|
||||||
|
/* format 7, but the data is format 6. We check whether we have */
|
||||||
|
/* an excessive number of bytes in the image: If it is equal to */
|
||||||
|
/* the value for a byte-aligned glyph, use the other loading */
|
||||||
|
/* routine. */
|
||||||
|
FT_UInt width = decoder->metrics->width;
|
||||||
|
FT_UInt height= decoder->metrics->width;
|
||||||
|
|
||||||
|
|
||||||
|
if ( height * ( ( width + 7 ) >> 3 ) == (FT_UInt)( p_limit - p ) )
|
||||||
|
loader = tt_sbit_decoder_load_byte_aligned;
|
||||||
|
else
|
||||||
loader = tt_sbit_decoder_load_bit_aligned;
|
loader = tt_sbit_decoder_load_bit_aligned;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
|
Loading…
Reference in New Issue