[File] MIME type for TrueType fonts
Reuben Thomas
rrt at sc3d.org
Mon Feb 3 13:11:09 UTC 2025
I was a bit surprised when running file on a TTF just now to get the MIME
type font/sfnt.
I did some digging. First, file seems to categorise all TTF fonts as
font/sfnt (it does emit "font/ttf" for TTCs, that is, TTF collections).
Secondly, I looked up the definition of font/sfnt:
https://www.iana.org/assignments/media-types/font/sfnt
In particular: "Note that "font/sfnt" is an abstract type from which the
(widely used in practice) "font/ttf" and "font/otf" types are
conceptually derived. Use of "font/sfnt" is likely to be rare in
practice…"
It then goes on to give examples that don't seem to apply in this case.
The relevant section of magic/Magdir/fonts says:
# True Type fonts
# Modified by: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/TrueType
# Reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/
However, cvs annotate tells me that the line in question was committed by
Christos in 2018:
286: 1.39 (christos 10-Dec-18): !:mime font/sfnt
the commit message refers to
https://www.iana.org/assignments/media-types/media-types.xhtml#table-font
Once again, I can't see why that MIME type would apply here; the context in
the patterns is that the font has just been unambiguously identified as TTF
(line 285).
Maybe the patterns used to be less specific, and when Joerg improved them
in 2021 he kept the MIME type? Sorry, I find CVS quite hard to work with
for history spelunking and I've not checked git history.
I'm happy to change "font/sfnt" to "font/ttf" here if there's no
disagreement.
--
https://rrt.sc3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20250203/aecff881/attachment.htm>
More information about the File
mailing list