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

Race, Pandemics, and the Work We Choose To Do

Way back in mid-March, we closed our office as a precautionary measure in response to COVID-19, and since then I have been planning (and planning and planning) to write about Pressbooks and the ways open digital technologies, open content, and open practices can be part of a resilience strategy in the face of upheavals like

Read More

Welcome Ricardo Aragón & Sarah Fennessey, Pressbooks’ Newest Team Members

We’re delighted to introduce Ricardo Aragón and Sarah Fennessey, the newest members of the Pressbooks organization. Ricardo has joined us as a full stack developer, and Sarah has taken the role of institutional sales manager.  Prior to joining Pressbooks, Ricardo spent several years working as a software developer for Argentinian technology companies, most recently serving

Read More

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