RESOLVED FIXED 254146
Can't activate feature with all caps tag via font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=254146
Summary Can't activate feature with all caps tag via font-feature-settings
elaine
Reported 2023-03-19 22:56:07 PDT
Created attachment 465513 [details] Test case The attached test case contains a version of the Ahem font with two new layout features, `cv01` and `XPOS`, identical except for their tags. The features contain a single rule (in afdko feature syntax): pos x <500 0 1000 0>; That is, modify the x glyph by increasing the xPosition by 500 font units and the advance by 1000 font units, effectively adding a half em of space on both sides of the glyph. In the attached index.html, the two lines of text are identical, except in the first the middle character is wrapped with a span that activates the cv01 feature, and in the second the middle character is wrapped with a span that activates the XPOS feature. The glyph's position is modified only in the first line. STEPS TO REPRODUCE Open the index.html in the attached archive. You do not need to run the Makefile; it and the UFO sources are attached for reference. The features can be found in Ahem-Regular.ufo/features.fea. EXPECTED RESULTS The two lines of text are identical. Observed in STP 165 and Safari 16.3 (18614.4.6.1.6) running on macOS 13.2.1 (22D68). Does not reproduce in Firefox 111 and Chrome 111. COMMENTARY I ran into this issue while implementing a feature that modified spacing for some punctuation characters, similar to the "PKRN" example Microsoft gives on https://learn.microsoft.com/en-us/typography/opentype/spec/featuretags. WORKAROUND Use one of the stylistic variant tags, like cv01–cv99 or ss01–ss20.
Attachments
Test case (132.21 KB, application/zip)
2023-03-19 22:56 PDT, elaine
no flags
Test case (132.24 KB, application/zip)
2023-03-19 23:01 PDT, elaine
no flags
elaine
Comment 1 2023-03-19 23:01:04 PDT
Created attachment 465514 [details] Test case
Antoine Quint
Comment 2 2023-03-20 08:37:20 PDT
I can reproduce with ToT.
Myles C. Maxfield
Comment 3 2023-03-20 15:26:43 PDT
Looks like the font we're creating doesn't actually have the XPOS feature set 🤔
Myles C. Maxfield
Comment 4 2023-03-20 15:41:33 PDT
Looks like we're lowercasing XPOS -> xpos
Myles C. Maxfield
Comment 5 2023-03-20 15:46:40 PDT
auto tag = consumeFontTag<FontTagCaseManipulation::ToASCIILower>(range); 🤔
Myles C. Maxfield
Comment 6 2023-03-20 15:48:30 PDT
http://w3c.github.io/csswg-drafts/css-fonts-4/#font-feature-settings-prop > The <string> is a case-sensitive OpenType feature tag.
Myles C. Maxfield
Comment 7 2023-03-20 15:50:28 PDT
The included font claims to be in the public domain, so I can just make a layout test with it.
Radar WebKit Bug Importer
Comment 8 2023-03-20 15:55:38 PDT
Myles C. Maxfield
Comment 9 2023-03-20 15:57:57 PDT
EWS
Comment 10 2023-03-31 21:09:00 PDT
Committed 262463@main (6e7c8de0a165): <https://commits.webkit.org/262463@main> Reviewed commits have been landed. Closing PR #11739 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.