Skip to content

The original font-face test turned into four tests, one font format each#307

Merged
iherman merged 1 commit intomainfrom
separating-css-fonts-per-formats
Jun 3, 2025
Merged

The original font-face test turned into four tests, one font format each#307
iherman merged 1 commit intomainfrom
separating-css-fonts-per-formats

Conversation

@iherman
Copy link
Copy Markdown
Member

@iherman iherman commented May 28, 2025

As agreed in #306 (comment) : the original font-face test separated into four separate tests, one each for the truetype, opentype, woff, and woff2 formats, respectively.

@iherman
Copy link
Copy Markdown
Member Author

iherman commented May 28, 2025

@mattgarrish I am not familiar with the "structural" tests used for epubcheck: shouldn't there be a test for each media type (including the non-standard ones)? (Maybe they are already there, though.)

@iherman
Copy link
Copy Markdown
Member Author

iherman commented May 28, 2025

w3c/epub-specs#2727 must be merged if this PR gets merged.

@mattgarrish
Copy link
Copy Markdown
Member

mattgarrish commented May 28, 2025

shouldn't there be a test for each media type (including the non-standard ones)?

Yes, there are two test files for font (and other) core media types:

The first test file is for the preferred media types - the ones listed first in the CMT table. So when this non-preferred media type for TTF is added it will go in the second file.

Since epubcheck will report the manifest entry that fails, it doesn't need multiple files to be as specific.

Is that what you wanted to know?

@iherman
Copy link
Copy Markdown
Member Author

iherman commented May 29, 2025

shouldn't there be a test for each media type (including the non-standard ones)?

Yes, there are two test files for font (and other) core media types:

The first test file is for the preferred media types - the ones listed first in the CMT table. So when this non-preferred media type for TTF is added it will go in the second file.

Since epubcheck will report the manifest entry that fails, it doesn't need multiple files to be as specific.

Is that what you wanted to know?

Yes, that is what I wanted to know indeed. What I would suggest (so that we would not forget) is to do the change in the second test right away (and then we can forget about this topic).

(I am not familiar with the testing structure, i.e., if just changing the OPF file is all that has to be done, or does it require other changes. If it is only the OPF file, then I am happy to raise a PR with the change.)

@mattgarrish
Copy link
Copy Markdown
Member

mattgarrish commented May 29, 2025

if just changing the OPF file is all that has to be done, or does it require other changes.

You'd also need to update the allowed font media types, otherwise epubcheck won't build with errors.

To do that, I believe you just need to add the media type the appropriate spots in isBlessedFontType and getPreferredMediaType.

@iherman
Copy link
Copy Markdown
Member Author

iherman commented May 30, 2025

Ok, I have created a PR for epubcheck: w3c/epubcheck#1614

Copy link
Copy Markdown
Member

@mattgarrish mattgarrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine per the spec, but I'm wondering why SVG fonts aren't in the list. I'll open an issue about this.

@iherman iherman merged commit 5763394 into main Jun 3, 2025
@iherman iherman deleted the separating-css-fonts-per-formats branch June 3, 2025 14:01
@github-project-automation github-project-automation bot moved this from In review to Done in PM/EPUB issues Jun 3, 2025
@iherman iherman removed this from PM/EPUB issues Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants