Read FeatureName of a stylistic set


I saw that stylistic set (ss01,…) are stocked into the “Name” table, like instance with an ID between 256 and 32767, according to Microsoft Docs:

UI Name ID:* The ‘name’ table name ID that specifies a string (or strings, for multiple languages) for a user-interface label for this feature. The value of uiLabelNameId is expected to be in the font-specific name ID range (256-32767), though that is not a requirement in this Feature Parameters specification. The user-interface label for the feature can be provided in multiple languages. An English string should be included as a fallback. The string should be kept to a minimal length to fit comfortably with different application interfaces.

When I read the font, with opentype.js tools, I have well the Feature Name given instead of ss01, ss02… stocked in the ‘Name’ Table / range 282 to 285:

I would like to know how to target the Custom name (like Uppercase A instead of ss01) in a js script.
Somebody could help me please?

Thanks so much.

The information which name ID is linked with an OpenType layout feature is not stored in the name table, but in the feature records in the GSUB or GPOS tables. Maybe opentype.js provides this info there.

1 Like

Thank you, I will take a look on Gsub. But why the names appears also on the Name table? With ID like instance, it’s strange…

Name IDs above 255 can be used for anything. So the feature records just point to any name table entry instead of storing the strings itself.

1 Like