CoreText: language to OpenType tag mapping
I'm working on a Burmese font which has support for Arakanese (Rakhine). Arakanese has ISO639-3 language tag
rki but OpenType language tag ARK. To simplify the problem I created a test font based on Fallback Plus, with the following rules:languagesystem mym2 dflt;
languagesystem mym2 ARK ;
feature locl {
script mym2;
language ARK ;
sub uni1000 by glyph01;
} locl;
i.e. when rendering Arakanese text, change the "Myanmar ka" glyph from uni1000 to glyph01. I then created a test HTML file:
<p lang="rki-Mymr">က</p>
<p lang="ark-Mymr">က</p>
Notice that the top row has the correct HTML lang attribute - i.e. the ISO language tag for the Rakhine language. The second row is bogus - it asks for Arikapú, an indigenous Brazilian language, but written in the Burmese script.
In Google Chrome:

(the top row is substituted for the "Arakanese" glyph, the second one is not).
In Safari:

The opposite happens. This suggests to me that CoreText (and I've confirmed this with hb-shape) is receiving the "rki" ISO language tag but is not mapping it correctly to the "ARK" OpenType tag and then applying those rules; but it is (erroneously) mapping the "ark" language tag straight through to the "ARK" OpenType tag. (See the language system tag list in the OpenType spec for the correct mapping.)
I haven't checked whether this is also the case for other complex shapers. gzip'd font attached.
Comments
-
(I've now convinced myself that this is a bug, and have also filed it as bug FB9809046 in Feedback Assistant.)2
Categories
- All Categories
- 46 Introductions
- 3.9K Typeface Design
- 486 Type Design Critiques
- 562 Type Design Software
- 1.1K Type Design Technique & Theory
- 654 Type Business
- 855 Font Technology
- 29 Punchcutting
- 519 Typography
- 119 Type Education
- 323 Type History
- 77 Type Resources
- 112 Lettering and Calligraphy
- 33 Lettering Critiques
- 79 Lettering Technique & Theory
- 552 Announcements
- 93 Events
- 114 Job Postings
- 170 Type Releases
- 174 Miscellaneous News
- 276 About TypeDrawers
- 54 TypeDrawers Announcements
- 120 Suggestions and Bug Reports