RESOLVED FIXED 21127
REGRESSION: CFF format fonts fail to load
https://bugs.webkit.org/show_bug.cgi?id=21127
Summary REGRESSION: CFF format fonts fail to load
John Daggett
Reported 2008-09-25 18:49:02 PDT
For pages using web fonts via @font-face rules, CFF formatted fonts fail to load (i.e. .otf fonts) under Windows XP. Traced this a bit in the debugger, within createFontCustomPlatformData (FontCustomPlatformData.cpp) the call to load the font via TTLoadEmbeddedFont fails with return code 0x0103, E_NAMECHANGEFAILED (defined in t2embapi.h). This is a regression, the page renders correctly with the latest Windows version of Safari, 3.1.2 (525.21). I'm guessing the difference is that 525.21 was using CoreGraphics to load the font(?).
Attachments
If TTLoadEmbeddedFont fails, use AddFontMemResourceEx after changing the font name in memory (11.41 KB, patch)
2008-09-30 16:39 PDT, mitz
hyatt: review+
mitz
Comment 1 2008-09-26 14:36:05 PDT
<rdar://problem/6202962> is about TTLoadEmbeddedFont failing with E_NAMECHANGEFAILED.
Alexey Proskuryakov
Comment 2 2008-09-28 15:29:46 PDT
(In reply to comment #1) > <rdar://problem/6202962> is about TTLoadEmbeddedFont failing with > E_NAMECHANGEFAILED. That was fixed in <http://trac.webkit.org/changeset/37042>.
mitz
Comment 3 2008-09-28 15:31:31 PDT
(In reply to comment #2) > (In reply to comment #1) > > <rdar://problem/6202962> is about TTLoadEmbeddedFont failing with > > E_NAMECHANGEFAILED. > > That was fixed in <http://trac.webkit.org/changeset/37042>. > Yup. Now loading the fonts in this bug fails with different error codes.
John Daggett
Comment 4 2008-09-28 16:42:57 PDT
From Simon Daniels, Microsoft: > Do you know if the font embedding API's under Windows support CFF > OpenType fonts? Yes we consider this a bug in t2embed.dll - historically (pre-OpenType) it rejected fonts without a glyf table. The fix is easy, but was not fixed in Vista due to concerns over the number of machines without CFF rasterizers. [Note: Windows 7 bug 257987]
Dave Hyatt
Comment 5 2008-09-28 19:43:31 PDT
We could fall back to the CoreGraphics rendering path...
Dave Hyatt
Comment 6 2008-09-28 19:44:10 PDT
... if t2embed fails I mean ....
mitz
Comment 7 2008-09-28 19:48:02 PDT
(In reply to comment #5) > We could fall back to the CoreGraphics rendering path... An HFONT is required for the complex script code path regardless of the rendering mode.
mitz
Comment 8 2008-09-30 16:16:58 PDT
mitz
Comment 9 2008-09-30 16:39:22 PDT
Created attachment 23962 [details] If TTLoadEmbeddedFont fails, use AddFontMemResourceEx after changing the font name in memory
Dave Hyatt
Comment 10 2008-09-30 23:17:45 PDT
Comment on attachment 23962 [details] If TTLoadEmbeddedFont fails, use AddFontMemResourceEx after changing the font name in memory r=me
mitz
Comment 11 2008-09-30 23:25:49 PDT
John Daggett
Comment 12 2008-10-02 01:38:09 PDT
Um, don't you need some buffer length checks in renameAndActivateFont, given that the input data could be intentionally malformed font data?
mitz
Comment 13 2008-10-02 01:52:33 PDT
(In reply to comment #12) > Um, don't you need some buffer length checks in renameAndActivateFont, given > that the input data could be intentionally malformed font data? I think I do not, given that data is passed to renameAndActivateFont only if getEOTHeader succeeds with the same data. If there is a deficiency in the code, please file a new bug, as the patch has landed and this bug is resolved.
Note You need to log in before you can comment on or make changes to this bug.