Forum How do I...?

internal error - no available fonts

erelsgl
I got an error message saying "prince: internal error: no available fonts".

After some debugging, I found that this error occurs only when my stylesheet includes an element with:
font-family: sans-serif


or
font-family: Arial, sans-serif


(or other families instead of Arial).


I have no idea why it happens. I just know that when I remove the "sans-serif" I don't get the error, and when I return it, the error comes back.
mikeday
This indicates that you do not have the Microsoft Core Fonts installed, as Prince will attempt to use Arial by default for sans-serif text as described in the fonts documentation.

The easiest solution is to install the msttcorefonts package, which includes the Times New Roman, Arial and Courier New fonts which Prince assigns to serif, sans-serif and monospace respectively.

Alternatively, if you have a preferred sans-serif TrueType font installed on your system already, you can edit the fonts.css file in the Prince installation to use it for the default sans-serif family.