https://github.com/python/cpython/commit/599bfc986d2c32c507822ef785b63619bd616608
commit: 599bfc986d2c32c507822ef785b63619bd616608
branch: main
author: Sahil Prajapati <sahilprjpt...@gmail.com>
committer: hugovk <1324225+hug...@users.noreply.github.com>
date: 2024-11-12T08:48:38+02:00
summary:

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+hug...@users.noreply.github.com>

files:
A Misc/NEWS.d/next/Library/2020-05-19-01-12-47.gh-issue-84852.FEjHJW.rst
M Doc/whatsnew/3.14.rst
M Lib/mimetypes.py
M Lib/test/test_mimetypes.py

diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index f9b219828d3d94..9c032637d651ec 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -366,6 +366,16 @@ json
 mimetypes
 ---------
 
+* Add MS and :rfc:`8081` MIME types for fonts:
+
+  * Embedded OpenType: ``application/vnd.ms-fontobject``
+  * OpenType Layout (OTF) ``font/otf``
+  * TrueType: ``font/ttf``
+  * WOFF 1.0 ``font/woff``
+  * WOFF 2.0 ``font/woff2``
+
+  (Contributed by Sahil Prajapati and Hugo van Kemenade in :gh:`84852`.)
+
 * Add :rfc:`9559` MIME types for Matroska audiovisual data container
   structures, containing:
 
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index fd343a78c98ae1..210d2264757d08 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -479,6 +479,7 @@ def _default_mime_types():
         '.m3u8'   : 'application/vnd.apple.mpegurl',
         '.xls'    : 'application/vnd.ms-excel',
         '.xlb'    : 'application/vnd.ms-excel',
+        '.eot'    : 'application/vnd.ms-fontobject',
         '.ppt'    : 'application/vnd.ms-powerpoint',
         '.pot'    : 'application/vnd.ms-powerpoint',
         '.ppa'    : 'application/vnd.ms-powerpoint',
@@ -543,6 +544,10 @@ def _default_mime_types():
         '.aiff'   : 'audio/x-aiff',
         '.ra'     : 'audio/x-pn-realaudio',
         '.wav'    : 'audio/x-wav',
+        '.otf'    : 'font/otf',
+        '.ttf'    : 'font/ttf',
+        '.woff'   : 'font/woff',
+        '.woff2'  : 'font/woff2',
         '.avif'   : 'image/avif',
         '.bmp'    : 'image/bmp',
         '.gif'    : 'image/gif',
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py
index 8d3e8fcafb6740..c4bb8dfb1a7422 100644
--- a/Lib/test/test_mimetypes.py
+++ b/Lib/test/test_mimetypes.py
@@ -228,12 +228,17 @@ def check_extensions():
                 ("application/postscript", ".ps"),
                 ("application/vnd.apple.mpegurl", ".m3u"),
                 ("application/vnd.ms-excel", ".xls"),
+                ("application/vnd.ms-fontobject", ".eot"),
                 ("application/vnd.ms-powerpoint", ".ppt"),
                 ("application/x-texinfo", ".texi"),
                 ("application/x-troff", ".roff"),
                 ("application/xml", ".xsl"),
                 ("audio/matroska", ".mka"),
                 ("audio/mpeg", ".mp3"),
+                ("font/otf", ".otf"),
+                ("font/ttf", ".ttf"),
+                ("font/woff", ".woff"),
+                ("font/woff2", ".woff2"),
                 ("image/avif", ".avif"),
                 ("image/webp", ".webp"),
                 ("image/jpeg", ".jpg"),
diff --git 
a/Misc/NEWS.d/next/Library/2020-05-19-01-12-47.gh-issue-84852.FEjHJW.rst 
b/Misc/NEWS.d/next/Library/2020-05-19-01-12-47.gh-issue-84852.FEjHJW.rst
new file mode 100644
index 00000000000000..2581697591af62
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-05-19-01-12-47.gh-issue-84852.FEjHJW.rst
@@ -0,0 +1,2 @@
+Add MIME types for MS Embedded OpenType, OpenType Layout, TrueType,
+WOFF 1.0 and 2.0 fonts. Patch by Sahil Prajapati and Hugo van Kemenade.

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to