Having a Problem with Pressbooks Custom CSS Fonts? Here’s How to Fix It!

If you are using Pressbooks Custom CSS as your Theme (which allows you to edit the design of your book), you might have noticed that your PDF (and possibly your EPUB) fonts have changed.

This is a result of a big change we made in how we generate our CSS files in the backend of Pressbooks, and moving the fonts from where they were … to somewhere else. In the long run, this will make Pressbooks much more flexible. In the short run, if you are using Custom CSS it might cause problems with fonts.

Here’s how to fix bad fonts in Custom CSS!

If you look at your Custom CSS editor (PDF version), you will find your fonts, listed something like this:


@font-face {
  font-family: "Cardo";
  font-weight: bold;
  font-style: normal;
  src: url(http://yourbookname.pressbooks.com/wp-content/themes/kolbert/export/prince/../../fonts/Cardob101.ttf) format("truetype");
}

@font-face {
  font-family: "Cardo";
  font-weight: normal;
  font-style: italic;
  src: url(http://yourbookname.pressbooks.com/wp-content/themes/kolbert/export/prince/../../fonts/Cardoi99.ttf) format("truetype");
}

The paths for all such fonts in your Custom CSS need to be edited/replaced as follows:

@font-face {
  font-family: "Cardo";
  font-weight: bold;
  font-style: normal;
src: url(themes-book/pressbooks-book/fonts/Cardob101.ttf) format("truetype");
}

@font-face {
  font-family: "Cardo";
  font-weight: normal;
  font-style: italic;
  src: url(themes-book/pressbooks-book/fonts/Cardoi99.ttf) format("truetype");
}

Related Posts

COVID-19, training, infrastructure and: stay safe.

Dear all, If you are anything like our small Pressbooks team, you’ve been shaken up COVID-19, professionally, and personally. Things are scary, the changes are fast and drastic. We don’t know how long this is going to last or what it will turn into.  In our own little company, things got very real very quickly. We

Read More

Welcome Amy Song, Pressbooks’ New Customer Support Specialist

We’re delighted to introduce you to Amy Song, the newest member of the Pressbooks organization.  Amy will be working from our Montréal office as our new customer support specialist, where she’ll be helping people use Pressbooks to meet their publishing and educational needs and maintaining our user-facing documentation and training resources.  Because Amy will soon

Read More

Join Us for Open Education Week: Language Diversity Showcase

Every year since 2013, the open education community comes together for one week to celebrate open education. This year Pressbooks is contributing to that celebration with a presentation: Diversity of Language in Open Educational Resources.  Please join us at 3pm EST on Thursday, March 5 for a 1-hour presentation. We’ve asked a few members of

Read More