Please expose the CSS name of a font face
Because CCS4 mandates width weight slant keyword naming derived from width weight slant values, but a lot of font makers ignore OpenType and CSS recommandations, and fontconfig messes up with the width weight slant scales used in specifications, it is not easy for the user to determine what is the CSS naming of installed font faces.
Please expose in fc-scan the width weight slant CSS keywords associated with an installed face:
- when they match perfectly (exact value specified in the spec): css-width, css-weight, css-stretch (one value or none per property)
- when they do not match perfectly, but would be aliased by the CSS resolution algorithm to this face, given the other faces available on system for this font family: css-width-aliases, css-weight-aliases, css-stretch aliases
For example, if a font family is available with the 350 and 700 weights:
- CSS would name the width for 700 Bold and make it an alias for ExtraBold, Black, SemiBold and Medium
- CSS would not have a canonical name for 350 but would make it an alias for Thin, ExtraLight, Light and Regular
The CSS spec is somewhat inconsistent with its keyword naming (sometimes in lowercase, sometimes in camelcase, sometimes with spaces), it’s ok to deviate a little from the letter of the spec to keep the way keywords are written consistent.
The aim is to give fontconfig users a clear idea of what a face would have been named if the font maker had applied the CSS model, how CSS/Web oriented software will name it, what CSS/web software will substitute it for
Since variable fonts enable the creation of more faces than defined by the CSS model some faces may end up with no CSS name (either canonical or aliased). CSS naming is not intended as a direct replacement of the style fontconfig field.