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

Alegreya as Header font replaced by Times New Roman in PDF exports #932

Closed
tw77 opened this issue Jan 20, 2022 · 2 comments
Closed

Alegreya as Header font replaced by Times New Roman in PDF exports #932

tw77 opened this issue Jan 20, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tw77
Copy link
Contributor

tw77 commented Jan 20, 2022

Description

We can set Alegreya as the Header font under Theme Options > PDF Options, but in an exported PDF, the Header font shows up as Times New Roman. Reported here: https://pressbooks.community/t/alegreya-not-working-in-pdf-export-option/1881

Replicated on a test book with the McLuhan theme. Also replicated with the Malala theme. The issue appears to be Alegreya-specific.

Steps to Reproduce

  1. Set a book's theme to McLuhan or Malala.
  2. Set Alegreya as the Header font in PDF Options.
  3. Export a PDF.

Expected behavior: Alegreya is used as the Header font in the exported PDF.

Actual behavior: Times New Roman is used as the Header font.

@tw77 tw77 added the bug Something isn't working label Jan 20, 2022
@tw77
Copy link
Contributor Author

tw77 commented Jan 20, 2022

Further details from toddhalvorsen on the forum:

“Upon researching this in Custom Styles, I see that the fonts for this option are incorrectly identified as Alegreya Sans SC:

@font-face {

font-family: ‘Alegreya Sans SC’;

src: url(‘fonts/AlegreyaSansSC-Medium.ttf’) format(‘truetype’);

font-weight: normal;

font-style: normal; }

While troubleshooting this problem, I created a custom PDF Style with the correct font identified, but either this font is not installed on the Pressbooks server or it is named differently, because this did not generate a PDF export using Alegreya, but instead defaulted again to Times New Roman.
this custom style did not work to solve the problem:

@font-face {

font-family: ‘Alegreya’;

src: url(‘fonts/Alegreya-Medium.ttf’) format(‘truetype’);

font-weight: normal;

font-style: normal; }

Upon further troubleshooting, when I place the Alegreya fonts on my own web server and direct the “src: url” to that location, the PDF outputs correctly with Alegreya as indicated.

The obvious conclusion is that the Alegreya font is not installed in the PB “fonts” directory, and the code which references it therefore fails to execute and substitutes the standard serif font, Times New Roman, in its place."

@SteelWagstaff
Copy link
Member

Tested and works as expected on integrations. Ready for release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants