Skip to content

Commit

Permalink
feat: update recognized font Core Media types
Browse files Browse the repository at this point in the history
Add the following media types as recognized Core Media Types for fonts:
- font/otf
- font/ttf
- font/woff
- font/woff2
- application/font-sfnt

Also add a WOFF2 declaration to the core media type test.

Fix #872, Fix #339
  • Loading branch information
mattgarrish authored and rdeltour committed Feb 19, 2019
1 parent 672ac6d commit ac2f1bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,13 @@ public static boolean isCommonVideoType(String type)

public static boolean isBlessedFontType(String type)
{
return type.equals("application/vnd.ms-opentype") || type.equals("application/font-woff")
return type.equals("font/otf")
|| type.equals("font/ttf")
|| type.equals("font/woff")
|| type.equals("font/woff2")
|| type.equals("application/font-sfnt")
|| type.equals("application/font-woff")
|| type.equals("application/vnd.ms-opentype")
|| type.equals("image/svg+xml");
}

Expand Down
1 change: 1 addition & 0 deletions src/test/resources/30/single/opf/valid/cmt.opf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<item id="font_001" href="font_001.otf" media-type="application/vnd.ms-opentype"/>
<item id="font_002" href="font_002.woff" media-type="application/font-woff"/>
<item id="font_003" href="font_003.svg" media-type="image/svg+xml"/>
<item id="font_004" href="font_004.woff2" media-type="font/woff2"/>
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml"/>
<item id="audio_001" href="audio_001.mpg" media-type="audio/mpeg"/>
<item id="audio_002" href="audio_002.mp4" media-type="audio/mp4"/>
Expand Down

0 comments on commit ac2f1bd

Please sign in to comment.