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

A Big, Warm Welcome to Pressbooks’ Newest team members: Carlos, Ho Man, and Başak

It’s time for us to lift the curtain on some major changes here at Pressbooks!  We’ve spent a lot of time over the last month doing some much-needed maintenance across the platform, including theme improvements and changes to the user experience for institutions using single-sign on technology. These past weeks also included important work on

Read More

Introducing: Malala

Take a look at our new textbook theme and try out its coolest feature: interchangeable fonts As some of you may have noticed, we have a tradition here at Pressbooks of naming our book themes after famous authors. We’ve tried to imprint the legacy that these authors and their books have left on literature onto

Read More

Scheduled Maintenance

To boost the performance and security of the Pressbooks.com network, we intend to perform scheduled maintenance on Thursday, Sept. 12 between 3 a.m. and 5 a.m. Eastern. What to expect. You can expect a short service interruption (1-2 minute downtime expected) at some point during this time frame, which would cut off any long processes like imports/exports.

Read More