Fri 03 Apr 2015 07:21:03 AM UTC, comment #12:
I wrote a bug report to Apple on march 31st, 2015 : 20359784:
Summary:
It seems that `HiraKakuProN-W3.ttf' included in iOS 8.2 on my iPhone 5 A1429 (Hiragino Kaku Gothic ProN W3; 8.2d6e1; 2014-12-19) needs eleven nesting levels for 4 glyphs (18736 / 19847 / 19848 / 19850). This Dainippon font violates the CFF specification : The spec (Type 2 Charstring Format, #5177, Appendix B) says "Subr nesting, stack limit 10" (http://partners.adobe.com/public/developer/en/font/5177.Type2.pdf page 33)
Steps to Reproduce:
It's impossible to load these 4 glyphs using latest FreeType (2.5.5)
See the bug report at FreeType team : https://savannah.nongnu.org/bugs/?44629
Expected Results:
The font should respect the spec.
Actual Results:
The font doesn't respect the spec. Unable to use this font on device with FreeType. On desktop, using this iOS font, the 4 glyphs are not rasterized in Adobe Photoshop... It should also an issue with PDF files build on iOS using this font when read on other platforms.
Version:
iOS 8.2
Notes:
Configuration:
iPhone 5 A1429 64Go
Attachments:
|
Fri 27 Mar 2015 08:24:15 AM UTC, comment #7:
Well, there is no bug at all! After adding some nesting information to FreeType's logging output it seems that `HiraKakuProN-W3.ttf' (Hiragino Kaku Gothic ProN W3; 8.2d6e1; 2014-12-19) needs eleven nesting levels! Below is the relevant output; for the other three problematic glyphs the log data is similar.
If my analysis is correct, this Dainippon font violates the CFF specification. However, I'm quite sure that other Adobe (and MS) environments render this font just fine – this means that the nesting level is higher in those environments. Jean-Baptiste, can you please check this my assumption? Can Acroread and MS Word display the missing glyphs? For example, glyph 18736 is character U+8E39 (踹).
Consequently, my suggestion is still to increase CF2_MAX_SUBR – FreeType's old CFF engine sets this value to 32, BTW.
======================================================================
cff_glyph_load: glyph index 18736
in subfont 11:
-63 57 279 54 -39 52 106 55 -13 52 47 52 96 54 hstemhm
81 5292 callsubr (idx 6423, entering level 1)
57 -50 55 71 57 42 56 return (leaving level 1)
66 60 -50 61 68 58 9 61 17 58 68 61 -39 60
cntrmask (maskbytes: 0x35 0x2A 0x80)
cntrmask (maskbytes: 0x0A 0xC5 0x40)
hintmask (maskbytes: 0x4E 0xE0 0x00)
214 -1126 callsubr (idx 5, entering level 1)
65 -787 callsubr (idx 344, entering level 2)
330 callsubr (idx 1461, entering level 3)
1479 callsubr (idx 2610, entering level 4)
rmoveto
-20 -6 -25 -6 -26 2044 callsubr (idx 3175, entering level 5)
-6 2231 callsubr (idx 3362, entering level 6)
rrcurveto
261 8611 callsubr (idx 9742, entering level 7)
vlineto
32 1 23 4 26 vhcurveto
-65 hlineto
return (leaving level 7)
3 -28 6127 callsubr (idx 7258, entering level 7)
2 -25 -30 vvcurveto
-272 vlineto
-40 -7 -1 0 -24 -3 17 -68 rcurveline
26 9 10 3 39 11 return (leaving level 7)
return (leaving level 6)
return (leaving level 5)
return (leaving level 4)
108 28 74 23 114 42 -2 57 rcurveline
-55 -21 -55 -19 -28 -8 rrcurveto
return (leaving level 3)
-749 callsubr (idx 382, entering level 3)
192 500 callsubr (idx 1631, entering level 4)
923 callsubr (idx 2054, entering level 5)
1133 callsubr (idx 2264, entering level 6)
2768 callsubr (idx 3899, entering level 7)
3501 callsubr (idx 4632, entering level 8)
26 13181 callsubr (idx 14312, entering level 9)
vlineto
31 27 -2 -3 26 -544 callgsubr (idx 587, entering level 10)
hvcurveto
64 vlineto
-4 return (leaving level 10)
-20 -703 callgsubr (idx 428, entering level 10)
-24 51 callgsubr (idx 1182, entering level 11) <-----
-1 -40 hhcurveto
return (leaving level 11)
...
|
Thu 26 Mar 2015 09:23:11 AM UTC, comment #4:
I can reproduce the bug, thanks. CCing Dave Arnold.
For glyph 18736, the problem is in routine `cf2_arrstack_setNumElements', which emits a `Stack_Overflow' error because the subroutine nesting level (value 10) is exceeded.
The fix is trivial, namely to increase CF2_MAX_SUBR in file `cf2_font.h'. The only question is to what value... Dave, please advise.
|