Status

()

Core
Graphics
RESOLVED FIXED
8 years ago
2 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

unspecified
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking2.0 betaN+)

Details

Attachments

(3 attachments)

(Assignee)

Description

8 years ago
Behdad has pushed a significant update to the harfbuzz-ng code, including the first complex-script shaper (for Arabic/Syriac/N'Ko), as well as various bug-fixes etc.

We should update our copy, and start using HB for shaping Arabic etc. (In particular, this will re-enable downloadable Arabic OpenType fonts on OS X, which have just been broken by the landing of OTS.)
(Assignee)

Comment 1

8 years ago
Created attachment 487448 [details] [diff] [review]
part 1 - updated harfbuzz code from upstream

Code from the harfbuzz-ng repository, as of 2010-11-01.
Attachment #487448 - Flags: review?(jdaggett)
(Assignee)

Comment 2

8 years ago
Created attachment 487453 [details] [diff] [review]
part 2 - update thebes harfbuzz integration for new script support

This enables harfbuzz rendering by default for Arabic (and related scripts), now that it supports the necessary shaping. With this patch, gfx.font_rendering.harfbuzz.level supports four levels:
0 - don't use harfbuzz for any scripts
1 - "simple" scripts only
2 [default] - also Arabic/Syriac/N'ko
3 - all scripts (even though Indic etc will not be shaped properly)

This enables downloadable OpenType fonts to work correctly for Arabic even on OS X - good testcases include http://webfonts.fonts.com/en-US/Project/ChooseFonts?fontQuery=arabic and the Nastaliq font example at http://pakdata.com/firefox-complex-script-font-rendering-problem. (Note that the latter does NOT render correctly via Core Text - some glyphs get mispositioned. But harfbuzz appears to handle it fine.)
Attachment #487453 - Flags: review?(jdaggett)

Updated

8 years ago
Attachment #487448 - Flags: review?(jdaggett) → review+

Updated

8 years ago
Attachment #487453 - Flags: review?(jdaggett) → review+

Comment 3

8 years ago
Note: I think we should add reftests for OT Arabic handling.  And the lack of automated tests for harfbuzz code is still a concern in my mind.
(Assignee)

Comment 4

8 years ago
(In reply to comment #3)
> Note: I think we should add reftests for OT Arabic handling.

Good point. That shouldn't be hard to do - I'll work up something.

>  And the lack of
> automated tests for harfbuzz code is still a concern in my mind.

Yes, that would also be good. I think it should be done as part of the upstream harfbuzz project rather than within our tree - though we may well want to contribute anyway, regardless of where it happens.
(Assignee)

Comment 5

8 years ago
Nominating this for blocking-2.0 as I think it's important to have the harfbuzz update that includes Arabic shaping support - this will re-enable Arabic-script downloadable fonts on OS X, which were effectively broken by the landing of OTS (bug 527276). There are enough Arabic webfonts out there (e.g. see http://webfonts.fonts.com/en-US/Project/ChooseFonts?fontQuery=arabic) that disabling them is a serious regression, and I don't think we should ship a final release that way.

(On non-Mac platforms, the OTS landing doesn't break Arabic webfonts because we allow the OpenType layout tables to be passed through to the platform; we don't allow this by default on OS X because we've seen too many crashes in OS X font code due to bad OpenType tables.)
blocking2.0: --- → ?
But wait, won't all other shaped fonts also have been disabled on OS X?

And, as a separate, less important question, does this shaper also support Persian?
blocking2.0: ? → betaN+

Comment 7

8 years ago
(In reply to comment #6)
> But wait, won't all other shaped fonts also have been disabled on OS X?

Only for *downloaded* fonts.  Shaping of platform fonts, both OpenType and AAT, will still happen as usual.
(Assignee)

Comment 8

8 years ago
(In reply to comment #7)
> (In reply to comment #6)
> > But wait, won't all other shaped fonts also have been disabled on OS X?
> 
> Only for *downloaded* fonts.  Shaping of platform fonts, both OpenType and AAT,
> will still happen as usual.

Right. And note that OS X has never supported shaping for Indic OpenType fonts (only Indic AAT); but there are very few Indic AAT fonts in circulation besides those that ship with the OS, as hardly anyone else makes AAT fonts. The only "complex" script where OS X supports *OpenType* shaping is Arabic, so that's the one that is important for @font-face deployment. There may well be sites deploying Indic OpenType fonts as well, but those have never shaped correctly on OS X (e.g. http://webfonts.fonts.com/en-US/Project/ChooseFonts?fontQuery=hindi doesn't shape correctly in Safari, either) and so there isn't the same regression issue.

(In reply to comment #6)

> And, as a separate, less important question, does this shaper also support
> Persian?

Yes.
(Assignee)

Comment 9

8 years ago
Created attachment 489427 [details] [diff] [review]
reftest for @font-face opentype arabic shaping

This is a simple testcase that checks the rendering of an Arabic word using DejaVu via @font-face, by comparing with a reference that uses the "pre-shaped" compatibility characters. It currently fails on OS X but should pass once we enable harfbuzz Arabic shaping.
Attachment #489427 - Flags: review?(jdaggett)

Updated

8 years ago
Attachment #489427 - Flags: review?(jdaggett) → review+
(Assignee)

Comment 10

8 years ago
Refreshed, tryserver-tested and pushed:
http://hg.mozilla.org/mozilla-central/rev/af5a5452cda4 (pt 1 - harfbuzz)
http://hg.mozilla.org/mozilla-central/rev/566c74963913 (workaround for gcc4.3 optimizer bug causing build failure on tryserver)
http://hg.mozilla.org/mozilla-central/rev/11ca3cd81864 (pt 2 - gfx integration)
http://hg.mozilla.org/mozilla-central/rev/7cf596b44baf (arabic shaping reftest)
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
(Assignee)

Updated

8 years ago
Depends on: 614903

Updated

8 years ago
Duplicate of this bug: 603346

Updated

3 years ago
Depends on: 1146859
You need to log in before you can comment on or make changes to this bug.