pressbooks / pressbooks-book

McLuhan is the default book theme for Pressbooks.
https://pressbooks.org
GNU General Public License v3.0
20 stars 16 forks source link

Unwanted info warnings for EPUB exports when using 'Ancient Greek' #1151

Closed SteelWagstaff closed 1 year ago

SteelWagstaff commented 1 year ago

When I add support for Ancient Greek to my book through theme options, Pressbooks imports two font families (GFS Neohellenic and SBL Greek): https://github.com/pressbooks/pressbooks-book/blob/dev/assets/book/typography/styles/_fonts-grc.scss

See https://github.com/pressbooks/pressbooks-book/blob/dev/assets/book/typography/styles/_GFSNeohellenicFont.scss + https://github.com/pressbooks/pressbooks-book/blob/dev/assets/book/typography/styles/_SBLGreekFont.scss

When I produce EPUB exports, I get unwanted info warnings about the GFSNeohellenic font: INFO(CSS-007): /srv/www/dev.pressbooks.network/releases/20230216165602/web/app/uploads/sites/3/pressbooks/exports/Test-Shape-Shifter-1676655539.epub/EPUB/mcluhan.css(30,3): Font-face reference "EPUB/assets/GFSNeohellenic.ttf" refers to non-standard font type "application/x-empty".

This appears related to an issue recently fixed by Ricardo: https://github.com/pressbooks/pressbooks/pull/3141 (https://github.com/pressbooks/pressbooks-book/issues/1119). I don't know why this particular font has the font type application/x-empty instead of `application/font/sfnt

To reproduce:

  1. Add 'Ancient Greek' to the 'Language & Script Support' option in McLuhan's global theme options Screenshot from 2023-02-17 10-01-46
  2. Turn on export notifications in Settings -> Export Screenshot from 2023-02-17 10-02-53
  3. Generate an EPUB export and observe the INFO warnings in the email Screenshot from 2023-02-17 10-03-26
SteelWagstaff commented 1 year ago

Found the reason -- the font files for GFS Neohellenic are in fact empty files! Same is true for Mono Font. Fixing with a PR shortly.

SteelWagstaff commented 1 year ago

Works as expected on dev networks. Ready for deploy.