[File] [PATCH] fonts: TrueType fonts lose their MIME type since the FontKit change
Christos Zoulas
christos at zoulas.com
Thu Oct 22 11:55:44 EDT 2026
Applied, thanks!
christos
> On Oct 21, 2026, at 10:33 AM, Nicolas Grekas <nicolas.grekas at gmail.com> wrote:
>
> Hi,
>
> Since fonts 1.55 ("Recognize FontKit"), plain TrueType fonts get no MIME type and no extension. Here is DejaVuSans-Bold.ttf, with magic/Magdir/fonts at 1.54 and then at 1.55:
>
> 1.54: TrueType Font data, 19 tables, 1st "FFTM", 26 names, Macintosh
> --mime-type: font/ttf, --extension: ttf/tte, --apple: ????tfil
> 1.55: TrueType Font data, 19 tables (FontKit), 1st "FFTM", 26 names, Macintosh
> --mime-type: application/octet-stream, --extension: ???, --apple: UNKNUNKN
>
> The !:mime, !:apple and !:ext lines now follow the new FontKit test, so they only apply to FontKit fonts. The new ">>>12 ubelong !0x464b2020" test also prints "(FontKit)" for every font that is not a FontKit one.
>
> The attached patch moves the FontKit test after the annotations of the TrueType line, and removes the description of the second test. Plain TrueType fonts get font/ttf back, and the output for a FontKit font doesn't change. I checked that with a copy of DejaVuSans-Bold.ttf where the first table tag is "FK ".
>
> PHP bundles libmagic in its fileinfo extension, and PHP 8.6 (in beta now) ships 5.48. So PHP apps will see TrueType uploads as application/octet-stream unless this is fixed before PHP 8.6.0.
>
> Thanks,
> Nicolas Grekas
>
> <fonts.patch>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.astron.com/pipermail/file/attachments/20261022/db776d24/attachment.htm>
More information about the File
mailing list