EPUBCheck CSS-019: empty @font-face rule
Updated:
EPUBCheck CSS-019 is a warning message: “CSS font-face declaration has no attributes.” An @font-face rule is empty, so it declares no font. EPUBCheck warns because the rule does nothing and usually means a font was removed only halfway.
The official message
CSS font-face declaration has no attributes.
- Default severity
- Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
- EPUBCheck version
- 5.4.0
Typical causes
- A rule left after its src and font-family were removed.
- A template stylesheet with placeholder @font-face blocks.
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Delete the empty @font-face rule.
- Or complete it with font-family and a src that points to a font file in the EPUB and the manifest.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the rule names a font in an unusual format, that is CSS-007.
Terms used here
Other CSS messages
CSS-015Alternative style sheets must have a title.CSS-028Use of Font-face declaration.CSS-029Found CSS class name "…" but no "…" property was declared in the package document.CSS-008An error occurred while parsing the CSS: ….CSS-030The package document declares media overlays styling class names but no CSS was found in the content document.CSS-007Font-face reference "…" refers to non-standard font type "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.