I noticed while looking for validation issues that technically no font media types have to be supported now.
We have a section for fonts in the core media types table, but core media types were clarified only as not requiring fallbacks. (It also doesn't make a lot of sense for fonts to be listed here, since CSS always defines a fallback font, so technically no font needs a fallback, but that's another issue.)
The bigger problem is that there isn't a reading system support requirement for the font media types in 2.2,[1] like there is for most of the other media types. I checked around in content documents and packages, as well, in case support was defined outside that section, but haven't found anything.
[1] https://w3c.github.io/publ-epub-revision/epub32/spec/epub-spec.html#sec-epub-rs-conf
I think we should have such a requirement. There are few things more important in content than having all the characters in text display properly. So either reading systems should be required to support literally every Unicode character, or font embedding MUST work. I expect the latter is more palatable to all involved :)
Ya, fonts are too important to leave the current ambiguity in place.
I suppose you could include a font family in an unsupported media type with a fallback to the same font family in a supported font media type, but why would you bother, and how likely is it that reading systems will "fix" the font import in the css?
My gut says we should just note in the CMT table that CSS already defines fallback rules, so any font media type can be embedded, with a pointer to where we define support for the four required media types.
I'm just not sure where we shift that requirement, as it means we need to insert a mini-table of media types somewhere. My only thought right now is to detail this as a subsection of the CSS profile section, with a reading system support requirement in 4.3 of Content Documents. That would then get captured in 2.2 by the requirement: "If it has a Viewport, it MUST support visual rendering of XHTML Content Documents as defined in CSS Style Sheets — Reading System Conformance [ContentDocs32]."
In 4.3, could we have a bullet that says:
It MUST support the font Core Media Type Resources when fonts are referenced via
@font-face.
My problem is it still leaves a high degree of silliness in the core media type table. What does it mean that only the listed font types can be used without fallbacks?
CSS has implicit fallback rules, so every font satisfies the requirement for a fallback, and that's what the core media type table should be making clear with a statement like we have for video:
EPUB 3 allows any font resource to be included without a fallback, as CSS already defines fallback rules for fonts. Refer to EPUB Content Documents for support requirements in EPUB Publications.
Otherwise, what does it mean for validation by epubcheck? What fallback satisfies the use of other font types?
I also noticed that font-face isn't part of the CSS profile yet, as its reference specification is still only a CR. What if we also just tweak your suggestion and add the four required support types to the end:
If it supports
@font-face, it MUST support [TrueType], [OpenType], [WOFF] and [WOFF2] font resources.
Is anything really lost by not listing a "preferred" media type for these, which is the only information that gets dropped by not using a table?
I also noticed that font-face isn't part of the CSS profile yet, as its reference specification is still only a CR. What if we also just tweak your suggestion and add the four required support types to the end:
CSS Fonts Level 3 (with @font-face) is REC and is listed in the first section of the current snapshot as being part of the official definition of CSS.
Three days ago it wasn't in there... ;)
But now that there's a new snapshot, the bullet could just be:
It MUST support [TrueType], [OpenType], [WOFF] and [WOFF2] font resources referenced from
@font-facerules.
(MDN lists the module as still at CR, btw.)
CSSWG has spent the last year focused on getting specs that were stuck in CR through the rest of the process. Sometimes the work pays off. Color and CSS UI hit REC in June, Fonts in September; Selectors in November. And we just updated the Snapshot a few days ago.
Hopefully fixed with #1221 and #1223
Most helpful comment
In 4.3, could we have a bullet that says: