Skip to content

Commit 599bfc9

Browse files
sahil290791blurb-it[bot]hugovk
authored
gh-84852: Add MIME types for .eot, ,otf, .ttf, .woff and .woff2 fonts (#20199)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent c45be8a commit 599bfc9

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ json
366366
mimetypes
367367
---------
368368

369+
* Add MS and :rfc:`8081` MIME types for fonts:
370+
371+
* Embedded OpenType: ``application/vnd.ms-fontobject``
372+
* OpenType Layout (OTF) ``font/otf``
373+
* TrueType: ``font/ttf``
374+
* WOFF 1.0 ``font/woff``
375+
* WOFF 2.0 ``font/woff2``
376+
377+
(Contributed by Sahil Prajapati and Hugo van Kemenade in :gh:`84852`.)
378+
369379
* Add :rfc:`9559` MIME types for Matroska audiovisual data container
370380
structures, containing:
371381

Lib/mimetypes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ def _default_mime_types():
479479
'.m3u8' : 'application/vnd.apple.mpegurl',
480480
'.xls' : 'application/vnd.ms-excel',
481481
'.xlb' : 'application/vnd.ms-excel',
482+
'.eot' : 'application/vnd.ms-fontobject',
482483
'.ppt' : 'application/vnd.ms-powerpoint',
483484
'.pot' : 'application/vnd.ms-powerpoint',
484485
'.ppa' : 'application/vnd.ms-powerpoint',
@@ -543,6 +544,10 @@ def _default_mime_types():
543544
'.aiff' : 'audio/x-aiff',
544545
'.ra' : 'audio/x-pn-realaudio',
545546
'.wav' : 'audio/x-wav',
547+
'.otf' : 'font/otf',
548+
'.ttf' : 'font/ttf',
549+
'.woff' : 'font/woff',
550+
'.woff2' : 'font/woff2',
546551
'.avif' : 'image/avif',
547552
'.bmp' : 'image/bmp',
548553
'.gif' : 'image/gif',

Lib/test/test_mimetypes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,17 @@ def check_extensions():
228228
("application/postscript", ".ps"),
229229
("application/vnd.apple.mpegurl", ".m3u"),
230230
("application/vnd.ms-excel", ".xls"),
231+
("application/vnd.ms-fontobject", ".eot"),
231232
("application/vnd.ms-powerpoint", ".ppt"),
232233
("application/x-texinfo", ".texi"),
233234
("application/x-troff", ".roff"),
234235
("application/xml", ".xsl"),
235236
("audio/matroska", ".mka"),
236237
("audio/mpeg", ".mp3"),
238+
("font/otf", ".otf"),
239+
("font/ttf", ".ttf"),
240+
("font/woff", ".woff"),
241+
("font/woff2", ".woff2"),
237242
("image/avif", ".avif"),
238243
("image/webp", ".webp"),
239244
("image/jpeg", ".jpg"),
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add MIME types for MS Embedded OpenType, OpenType Layout, TrueType,
2+
WOFF 1.0 and 2.0 fonts. Patch by Sahil Prajapati and Hugo van Kemenade.

0 commit comments

Comments
 (0)