Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation errors shown when exporting an EPUB: #3136

Closed
SteelWagstaff opened this issue Jan 20, 2023 · 15 comments
Closed

Validation errors shown when exporting an EPUB: #3136

SteelWagstaff opened this issue Jan 20, 2023 · 15 comments
Assignees

Comments

@SteelWagstaff
Copy link
Member

SteelWagstaff commented Jan 20, 2023

We observed the following validation errors when exporting an EPUB on our integrations network. They seem to indicate an issue with how the theme CSS files are declared or referenced in the EPUB's package document.

Array
(
[time] => Wed Jan 18 17:05:31 2023
[user] => thomas
[site_url] => https://integrations.pressbooks.network/testshapeshifter2023
[blog_id] => 706
[theme] => McLuhan
)
ERROR(OPF-014): /srv/www/integrations.pressbooks.network/releases/20230118044402/web/app/uploads/sites/706/pressbooks/exports/Test-Shape-Shifter-1674061522.epub/EPUB/mcluhan.css(0,0): The property "remote-resources" should be declared in the OPF file.
ERROR(RSC-006): /srv/www/integrations.pressbooks.network/releases/20230118044402/web/app/uploads/sites/706/pressbooks/exports/Test-Shape-Shifter-1674061522.epub/EPUB/mcluhan.css(3,9): Remote resource reference not allowed; resource must be placed in the OCF.
ERROR(RSC-006): /srv/www/integrations.pressbooks.network/releases/20230118044402/web/app/uploads/sites/706/pressbooks/exports/Test-Shape-Shifter-1674061522.epub/EPUB/mcluhan.css(4,9): Remote resource reference not allowed; resource must be placed in the OCF.

Check finished with errors

Originally posted by @tw77 in https://github.com/pressbooks/private/issues/1080#issuecomment-1387423329

@richard015ar richard015ar self-assigned this Jan 23, 2023
@richard015ar
Copy link
Contributor

I am not able to replicate the validation issues mentioned.
Nevertheless, I can see new ones:

INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(5,3): Font-face reference "EPUB/assets/Lora-Bold.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(11,3): Font-face reference "EPUB/assets/Lora-BoldItalic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(17,3): Font-face reference "EPUB/assets/Lora-Italic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(23,3): Font-face reference "EPUB/assets/Lora-Regular.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(29,3): Font-face reference "EPUB/assets/CormorantGaramond-Bold.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(35,3): Font-face reference "EPUB/assets/CormorantGaramond-BoldItalic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(41,3): Font-face reference "EPUB/assets/CormorantGaramond-Italic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /app/web/app/uploads/sites/39/pressbooks/exports/LTI-Demo-Book-1674495306.epub/EPUB/mcluhan.css(47,3): Font-face reference "EPUB/assets/CormorantGaramond-Regular.ttf" refers to non-standard font type "font/sfnt".

It seems that fonts source are not between double quotes after compiling, and maybe that's the issue:

@font-face {
  font-family: "Lora";
  src: url(assets/Lora-Bold.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Lora";
  src: url(assets/Lora-BoldItalic.ttf) format("truetype");
  font-weight: bold;
  font-style: italic;
}

@SteelWagstaff
Copy link
Member Author

Thanks @richard015ar for these INFO notes, that's a known issue and outside the scope of this ticket. See pressbooks/pressbooks-book#1119

@richard015ar
Copy link
Contributor

richard015ar commented Jan 23, 2023

I found the problem. It was an EPUB 3.2 spec requirement that we were not meeting. Fix in: #3141

@SteelWagstaff
Copy link
Member Author

Nice find and fix Ricardo! Thank you for this.

@richard015ar
Copy link
Contributor

PR: #3141

@fdalcin fdalcin removed their assignment Jan 25, 2023
@SteelWagstaff
Copy link
Member Author

Can we reproduce this issue on our dev networks or locally? If not, let's close for now.

@tw77
Copy link
Contributor

tw77 commented Jan 26, 2023

@richard015ar richard015ar self-assigned this Jan 26, 2023
@richard015ar
Copy link
Contributor

Please add your planning poker estimate with Zenhub @fdalcin

@tw77
Copy link
Contributor

tw77 commented Jan 30, 2023

This is actually also present on production networks; it can be replicated by cloning the affected book to University and exporting it as an EPUB: https://university.pressbooks.pub/testshapeshifter2023clone/wp-admin/admin.php?page=pb_export

@tw77
Copy link
Contributor

tw77 commented Jan 30, 2023

Using Theme Defaults for fonts in Ebook Options results in different validation errors when exporting this book as an EPUB.

With Header and Body Fonts set to Theme Defaults in Ebook Options:

Array
(
    [
time] => Mon Jan 30 18:15:23 2023
    [user] => thomas
    [site_url] => https://university.pressbooks.pub/testshapeshifter2023clone
    [blog_id] => 966
    [theme] => McLuhan
)
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(4,3): Font-face reference "EPUB/assets/Lora-Bold.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(9,3): Font-face reference "EPUB/assets/Lora-BoldItalic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(14,3): Font-face reference "EPUB/assets/Lora-Italic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(19,3): Font-face reference "EPUB/assets/Lora-Regular.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(24,3): Font-face reference "EPUB/assets/CormorantGaramond-Bold.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(29,3): Font-face reference "EPUB/assets/CormorantGaramond-BoldItalic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(34,3): Font-face reference "EPUB/assets/CormorantGaramond-Italic.ttf" refers to non-standard font type "font/sfnt".
INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(39,3): Font-face reference "EPUB/assets/CormorantGaramond-Regular.ttf" refers to non-standard font type "font/sfnt".

With different Header and Body Fonts selected in Ebook Options:

Array
(
    [time] => Mon Jan 30 18:19:49 2023
    [user] => thomas
    [site_url] => https://university.pressbooks.pub/testshapeshifter2023clone
    [blog_id] => 966
    [theme] => McLuhan
)
ERROR(OPF-014): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(0,0): The property "remote-resources" should be declared in the OPF file.
ERROR(RSC-006): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(2,9): Remote resource reference not allowed; resource must be placed in the OCF.
ERROR(RSC-006): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(3,9): Remote resource reference not allowed; resource must be placed in the OCF.

Check finished with errors

@richard015ar
Copy link
Contributor

richard015ar commented Jan 30, 2023

For the issue:

INFO(CSS-007): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102511.epub/EPUB/mcluhan.css(4,3): Font-face reference "EPUB/assets/Lora-Bold.ttf" refers to non-standard font type "font/sfnt".

It was fixed in #3141

The issue mentioned:

ERROR(OPF-014): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(0,0): The property "remote-resources" should be declared in the OPF file.
ERROR(RSC-006): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(2,9): Remote resource reference not allowed; resource must be placed in the OCF.
ERROR(RSC-006): /srv/www/university.pressbooks.pub/releases/20221223162849/web/app/uploads/sites/966/pressbooks/exports/Test-Shape-Shifter-1675102779.epub/EPUB/mcluhan.css(3,9): Remote resource reference not allowed; resource must be placed in the OCF.

I think it is a font issue. This is the CSS exported mcluhan.css that tries to import the fonts:

@charset "UTF-8";
/* stylelint-disable no-invalid-position-at-import-rule */
@import "https://fonts.googleapis.com/css?family=Roboto&display=swap";
@import "https://fonts.googleapis.com/css?family=Cormorant+Garamond&display=swap";
body, .entry-content {
  color: initial;
}

I think that's the issue.

@richard015ar
Copy link
Contributor

I can confirm it happens when we select any font other than Theme default in Ebook Theme options.

@SteelWagstaff
Copy link
Member Author

@tw77
Ready for testing. See #3159 for testing notes. Please also test the cover generator and make sure that EPUB/PDF exports made after using the cover generator work without additional errors.

@SteelWagstaff
Copy link
Member Author

I don't think this PR was autodeployed to dev.pressbooks.network. Looking into it now (sigh)

@fdalcin
Copy link
Contributor

fdalcin commented Jan 31, 2023

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

No branches or pull requests

4 participants