Please generate standard uniform and translatable style names from their width/weight/stant characteristics
The OpenType and CSS specs specify the standard keywords use to name specific values on the width weight slant
scale.
This can be used to compute standard face names for faces that match those values (and both Windows and Inkscape are using this facility to provide nice standard and translated face names).
Please perform the same computation in fontconfig so fonts that conform to standard width weight slant
values get exposed with a standard face name to apps, and this standard name can be translated GUI-side.
As noted by the OpenType spec authors:
usWeightClass values use the same scale as the 'wght' axis that is used in the 'fvar' table of variable fonts and in the STAT table usWidthClass values are related to but distinct from the scale for the 'wdth' axis that is used in the 'fvar' table of variable fonts and in the STAT table
Thus, it is expected that the exact weight/width values used by font faces may differ slightly from the exact values specified in the OS/2 and CSS tables (for example, Plex Sans uses a 85% width step, when the OpenType/CSS standard is 87.5%). Therefore matching to standard names should be done with an error margin (for example, match if the face or variable instance value is within 10% of the standard value).
As per the spec style name should be generated in width weight slant
keyword order
If the generated style name collides with names used in other faces, and those other names are not regenerated to something else, either:
- do the rename anyway (forcing the naming of the non-compliant font files to be fixed manually in fontconfig rules) or
- rename the offending style that used a standard name for something else (prepend a NonStandard keyword to the offending style name)
- abort the renaming of the colliding style (that may seem the least dangerous option, but the font will still break in apps due to its spec deviation, and silently passing broken faces to apps is not a good idea)
Real-world software is more aggressive than that: Inkscape won’t expose naming that does not follow the OS/2 scale at all in its font selector. However this seems excessive to me, given that variable fonts are enabling the creation of more faces than allowed by the CSS and OpenType specs. Just normalising the face naming when it matches standard characteristics, and letting face names that do not match those characteristics unchanged, should be enough