please do not register WOFF(2) fonts
Submitted by Fabian Greffrath
Assigned to fon..@..op.org
Link to original bug (#101270)
Description
Created attachment 131636 We don't register WOFF(2) fonts with fontconfig because of the W3C spec
Forwarded from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863835
Dear fontconfig devs,
currently, fontconfig registers all fonts installed into the /usr/share/fonts directory hierarchy. This may, however, contain fonts that are not meant to be exposed to general applications and are only there to adhere to the FHS specs.
One example are fonts in the WOFF(2) file formats. From the official W3C WOFF specs (https://www.w3.org/TR/WOFF/):
"2. General Requirements
The primary purpose of the WOFF format is to package fonts linked to Web documents by means of CSS @font-face rules. User agents supporting the WOFF file format for linked fonts must respect the requirements of the CSS3 Fonts specification ([CSS3-Fonts] Section 4.1: The @font-face rule). In particular, such linked fonts are only available to the documents that reference them; they MUST NOT be made available to other applications or documents on the user's system.
NOTE: the WOFF format is intended for use with @font-face to provide fonts linked to specific Web documents. Therefore, WOFF files must not be treated as an installable font format in desktop operating systems or similar environments. The WOFF-packaged data will typically be decoded to sfnt format for use by existing font-rendering APIs that expect OpenType font data, but such decoded font must not be exposed to other documents or applications."
So, please refrain from registering fonts in WOFF(2) formats with fontconfig. This can be achieved by installing the attached fontconfig snippet, courtesy of Nicolas Spalinger nicolas_spalinger@sil.org, as /etc/fonts/conf.d/70-no-woffs.conf .
I'd prefer to reject these fonts based on the fontformat information, but fontconfig reports them to be in "TrueType" format on the systems that I currently have access to. Alternatively, the globbing could be changed to apply to the file name extension, if fontconfig supports that (the user docs state that "globs only apply to directories, not to individual fonts" although it provides "*.pcf.gz" among the examples).
Thanks!
Cheers,
- Fabian
Attachment 131636, "We don't register WOFF(2) fonts with fontconfig because of the W3C spec":
70-no-woffs.conf