CoreText: language to OpenType tag mapping

I don't know if this is a bug, but I think it probably is.

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.)
Sign In or Register to comment.