diff --git a/data/custom.xml b/data/custom.xml index 64264d1..058b351 100644 --- a/data/custom.xml +++ b/data/custom.xml @@ -67,7 +67,7 @@ - + @@ -77,4 +77,26 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/marcel/mime_type/definitions.rb b/lib/marcel/mime_type/definitions.rb index e3a14ad..bba230c 100644 --- a/lib/marcel/mime_type/definitions.rb +++ b/lib/marcel/mime_type/definitions.rb @@ -38,6 +38,7 @@ Marcel::MimeType.extend "video/mp4", magic: [[4, "ftypisom"], [4, "ftypM4V "]], extensions: %w( mp4 m4v ) Marcel::MimeType.extend "font/ttf", magic: [[0, "\x00\x01\x00\x00"]], extensions: %w( ttf ttc ) +Marcel::MimeType.extend "font/otf", magic: [[0, "OTTO"]], extensions: %w( otf ), parents: "font/ttf" Marcel::MimeType.extend "application/vnd.adobe.flash.movie", magic: [[0, "FWS"], [0, "CWS"]], extensions: %w( swf ) Marcel::MimeType.extend "application/sql", extensions: %w( sql ) Marcel::MimeType.extend "text/vcard", magic: [[0, "BEGIN:VCARD"]], extensions: %w( vcf ), parents: "text/plain" diff --git a/lib/marcel/tables.rb b/lib/marcel/tables.rb index d4659c6..16bf470 100644 --- a/lib/marcel/tables.rb +++ b/lib/marcel/tables.rb @@ -1139,6 +1139,8 @@ module Marcel 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wmz' => 'application/x-ms-wmz', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', 'wp' => 'application/vnd.wordperfect', 'wp5' => 'application/vnd.wordperfect', 'wp6' => 'application/vnd.wordperfect', @@ -1908,6 +1910,8 @@ module Marcel 'chemical/x-csml' => [%w(csml), %w(), nil], 'chemical/x-pdb' => [%w(pdb), %w(), 'Brookhaven Protein Databank File'], 'chemical/x-xyz' => [%w(xyz), %w(), nil], + 'font/woff' => [%w(woff), %w(), nil], + 'font/woff2' => [%w(woff2), %w(), nil], 'image/aces' => [%w(exr), %w(), 'ACES Image Container File'], 'image/avif' => [%w(avif), %w(), 'AV1 Image File'], 'image/bmp' => [%w(bmp dib), %w(), 'Windows bitmap'], @@ -2399,6 +2403,8 @@ module Marcel ['audio/x-ms-wma', [[0..8192, 'Windows Media Audio']]], ['audio/x-pn-realaudio', [[0, ".ra\375"]]], ['chemical/x-cdx', [[0, 'VjCD0100']]], + ['font/woff', [[0, 'wOFF']]], + ['font/woff2', [[0, 'wOF2']]], ['image/aces', [[0, "v/1\001\002\000\000\000"], [0, "v/1\001\002\004\000\000"]]], ['image/cgm', [[0, 'BEGMF']]], ['image/emf', [[0, "\001\000\000\000", [[40, ' EMF']]]]], diff --git a/test/fixtures/magic/font/otf.otf b/test/fixtures/magic/font/otf.otf new file mode 100644 index 0000000..5baba2d Binary files /dev/null and b/test/fixtures/magic/font/otf.otf differ diff --git a/test/fixtures/magic/font/woff.woff b/test/fixtures/magic/font/woff.woff new file mode 100644 index 0000000..55d893b Binary files /dev/null and b/test/fixtures/magic/font/woff.woff differ diff --git a/test/fixtures/magic/font/woff2.woff2 b/test/fixtures/magic/font/woff2.woff2 new file mode 100644 index 0000000..076b416 Binary files /dev/null and b/test/fixtures/magic/font/woff2.woff2 differ diff --git a/test/fixtures/name/font/otf.otf b/test/fixtures/name/font/otf.otf new file mode 100644 index 0000000..5baba2d Binary files /dev/null and b/test/fixtures/name/font/otf.otf differ diff --git a/test/fixtures/name/font/woff.woff b/test/fixtures/name/font/woff.woff new file mode 100644 index 0000000..55d893b Binary files /dev/null and b/test/fixtures/name/font/woff.woff differ diff --git a/test/fixtures/name/font/woff2.woff2 b/test/fixtures/name/font/woff2.woff2 new file mode 100644 index 0000000..076b416 Binary files /dev/null and b/test/fixtures/name/font/woff2.woff2 differ