Provide a way to detect WOFF/WOFF2 fonts
Related to #92
Some distributions install WOFF and WOFF2 fonts in directories indexed by FontConfig and FontConfig will list them like any other format it supports.
Applications that don’t support WOFF/WOFF2 fonts, however, have no simple way of detecting such fonts and filtering them out. The FC_FONTFORMAT
of the pattern reports the format of the uncompressed font file and there is no indication that it is a WOFF/WOFF2 file.
Applications are left with either:
- Filtering based on file extension, which is brittle
- Sniffing the format by opening the file and reading its header, which is likely to be slow, and applications might need to cache it, defeating the one of the benefits of using FontConfig.
I think either FC_FONTFORMAT
should be extended to report also WOFF/WOFF2, e.g. WOFF-CFF
, WOFF-TTF
, and so on, or a new property, e.g., FC_FONTCONTAINER
or some such would be supoprted. The later might even be help distingush naked CFF fonts from CFF in SFNT fonts as currently both report font format of CFF
.