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
- 47 Introductions
- 4K Typeface Design
- 493 Type Design Critiques
- 576 Type Design Software
- 1.1K Type Design Technique & Theory
- 670 Type Business
- 884 Font Technology
- 29 Punchcutting
- 537 Typography
- 124 Type Education
- 332 Type History
- 81 Type Resources
- 113 Lettering and Calligraphy
- 33 Lettering Critiques
- 80 Lettering Technique & Theory
- 569 Announcements
- 100 Events
- 116 Job Postings
- 170 Type Releases
- 182 Miscellaneous News
- 270 About TypeDrawers
- 54 TypeDrawers Announcements
- 114 Suggestions and Bug Reports