After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 439298 - OpenType feature apply order
OpenType feature apply order
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.16.x
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 343111
 
 
Reported: 2007-05-17 21:10 UTC by Behdad Esfahbod
Modified: 2012-08-25 19:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2007-05-17 21:10:54 UTC
Pango currently applies OpenType features in the order added to the ruleset.  This is problematic as the OT spec doesn't order the features, and that when we allow OT feature attributes in the future, there's no meaningful way to order them.

As pointed in bug 325714, features should be applied in the font order, and it's the fonts' responsibility to order them correctly.  This makes a lot of sense and is most probably what was meant by the OT spec.

However, Owen points out that Pango used to work that way but many Indic fonts were not working, so the ruleset order was followed.

Digging history, seems like that's not quite the case.  As far as can be seen in history, it was introduced to fix a certain Arabic font.  Bug 122330.

Anyway, we need to figure out if we can revert that change.  If not, we need to support both orders, and choose on a per-engine basis.  We can dump the features in fonts and see if they follow the order the module would use them.
Comment 1 Behdad Esfahbod 2007-10-16 23:34:55 UTC
I asked on OpenType list, and George Williams says that lookups should be applied in the order they appear in LookupList, such that lookups from various features can interweave.  Makes a lot of sense indeed, and is what pango used to do.

Adam Twardoch adds that he believes Uniscribe reorders lookups into the "standard" order for Arabic, because the early "TrueType Open" Arabic fonts were produced with the assumption that lookup order doesn't matter.
Comment 2 Behdad Esfahbod 2007-10-17 18:15:41 UTC
More progress, seems like there are in fact three steps:

  - Standard GSUB features, applied one by one.

  - Remaining GSUB features, applied all at once, by lookup index order.

  - All GPOS features, applied all at once, by lookup index order.
Comment 3 Behdad Esfahbod 2007-10-22 22:10:10 UTC
Also seems like ccmp and locl are applied together at the very beginning.
Comment 4 Behdad Esfahbod 2008-07-03 19:15:27 UTC
Paul Nelson casually confirmed that the three-step process is what it should look like:

  - Preparatory features applied combined:  ccmp, locl, rtla, ...

  - Per-script shaping, features applied one at a time

  - Any other features, applied combhined
Comment 5 Behdad Esfahbod 2012-08-25 19:22:47 UTC
Fixed in HarfBuzz.