Closed Bug 602411 Opened 16 years ago Closed 14 years ago

Sanitize AAT font tables in OTS

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jtd, Unassigned)

References

()

Details

The linked testcase will work with current trunk code on OSX but once the OTS sanitizer code (bug 527276) lands, it will break. This is because OTS currently strips out tables it doesn't explicitly sanitize, including the mort/morx AAT tables needed for complex script rendering on OSX. Note: CoreText supports rendering of Arabic OpenType fonts but does not support the rendering of Indic OpenType fonts. Only AAT fonts are currently supported for these scripts. I wouldn't consider this high priority but nice to have in the future.
I'm not convinced this will ever be worth doing. It seems to me the only way sites might use AAT fonts is (as you suggest) when they serve fonts for a script that CoreText does not support OpenType shaping for; then they might ship an OpenType font for Windows users and an AAT font for Mac users. But do any sites actually do this currently, and if so, how do they ensure that the right font is selected on each platform? In the long term we will support OpenType shaping of Indic and other scripts using Harfbuzz, so that use case will be covered without needing AAT support. On the flip side, code to sanitize AAT represents a maintenance burden and also potential attack surface. So we'd need some real use cases to justify adding it.
I'm not advocating this but since there's a window between when FF4 is released and we implement complex shaping for Arabic/Devanagari during which there will be no way of supporting downloadable fonts for complex scripts, I felt I should log this. All such bugs should be marked as duplicates of this one. When harfbuzz shaping is enabled for all scripts we can close this as WONTFIX.
(In reply to comment #2) > I'm not advocating this but since there's a window between when FF4 is released > and we implement complex shaping for Arabic/Devanagari during which there will > be no way of supporting downloadable fonts for complex scripts, I felt I should > log this. Now that OTS has landed on 1.9.2, the window has gotten a lot wider: "now" (or when 3.6.13 ships) to "sometime after Firefox 4", including potentially "breaking" sites with this behavior in a Gecko security update. (In reply to comment #1) > It seems to me the only way sites might use AAT fonts is (as you suggest) when > they serve fonts for a script that CoreText does not support OpenType shaping > for; then they might ship an OpenType font for Windows users and an AAT font > for Mac users. On 1.9.2, there's no CoreText in Gecko, only ATSUI. Also, I wouldn't put it past someone to be using a Roman AAT font (something like Zapfino) for some nifty demo. > But do any sites actually do this currently This I can't answer. > how do they ensure that the right font is selected on each platform? The same way that people have been serving different fonts to different platforms since the beginning of CSS? Detect the browser's platform and either insert a separate platform-specific stylesheet into the DOM/markup, or insert a class (e.g. <body class="mac gecko">) into the DOM/markup, or some combination of the two. I do understand the drawbacks/constraints already outlined, but given that this was all laid out in context of the trunk and this is now no longer a trunk-only issue, I wanted to make sure this issue was at least re-evaluated in light of the stable release branch.
Another issue is that Firefox on OS X prefers AAT fonts over OpenType fonts, even though AAT fonts are no longer shaped. With the addition of Harfbuzz, maybe OpenType fonts should be the default on every OS.
Now that we shape Arabic and Devanagari scripts using Harfbuzz, I don't think this is of that much importance any more. Feel free to reopen if you disagree, of course.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Just a FYI. I may end up implementing 'morx' AAT shaping HarfBuzz. Eventually...
You need to log in before you can comment on or make changes to this bug.