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

Update: OEN member discount continued and refreshed

Pressbooks offers institutional and allied members of OEN 30% off single-institution PressbooksEDU networks Together, Pressbooks and the Open Education Network are working to grow sustainable open online learning ecosystems. When

Read More

Announcement: Discount for Minority Serving Institutions

Pressbooks is partnering with Achieving the Dream to offer MSIs 30% off single-institution networks It is very important for Pressbooks to better serve and support communities that have been historically

Read More

Pressbooks.com Scheduled Maintenance: August 9th, 5 – 7 a.m. EST

We intend to perform scheduled maintenance (required database updates) on the server hosting Pressbooks.com between 5 a.m.-7 a.m. ET on Sunday, August 9.¬† Pressbooks.com will be unavailable at some points during

Read More