Forum How do I...?

Adding Additional Fonts?

nadams
I have added custom fonts to RHEL 7. But for some reason when I try and process a HTML file and run --debug I don't see Prince registering the new fonts. Any help would be appreciated.
mikeday
Does the font family show up if you run "fc-list FamilyName" on the command-line?
nadams
Yes, they show up when I run fc-list from the command line.
mikeday
But it doesn't work if you try a simple document like this:
<html>
<body style="font-family: FamilyName">
simple text here
</body>
</html>

and run "prince --verbose test.html" to see which fonts are being used?
nadams
Yes, that didn't appear to work from what I understand.

Edited by nadams

mikeday
What is the name of the fonts? Does Prince print any error or warning messages? Can you paste the log output you get when running Prince with the --verbose option?
nadams
During the test, I had a typo in my FamilyName. I just tried it again and the test worked. I will work with the developer to do more testing.

I ran the following:
./prince --verbose test.html

I got the following verbose information:
prince: loading document: /opt/prince/lib/prince/license/license.dat
prince: Loading document...
prince: loading HTML5 input: test.html
prince: loading document: test.html
prince: Applying style sheets...
prince: Preparing document...
prince: Converting document...
prince: used font: Pahoran ldsLat, Roman
prince: Finished: success
nadams
What is the best way to use all the fonts in the family? For example I want to use the fonts below listed when I do an 'fc-list".

Pahoran ldsLat:style=Roman,Regular
Pahoran ldsLat,Pahoran ldsLat Condensed:style=Condensed Roman,Regular
Pahoran ldsLat:style=Italic
Pahoran ldsLat,Pahoran ldsLat Condensed:style=Condensed Bold,Bold
Pahoran ldsLat,Pahoran ldsLat Condensed:style=Condensed Italic,Italic
Pahoran ldsLat:style=Bold Italic
Pahoran ldsLat,Pahoran ldsLat Condensed:style=Condensed Bold Italic,Bold Italic
Pahoran ldsLat:style=Bold
mikeday
You should be able to use them by specifying various combinations of these CSS properties:
font-family: "Pahoran IdsLat";
font-weight: bold;
font-style: italic;
font-stretch: condensed;
nadams
That did the trick. Thank you for your help!


prince: loading document: /opt/prince/lib/prince/license/license.dat
prince: Loading document...
prince: loading HTML5 input: test.html
prince: loading document: test.html
prince: Applying style sheets...
prince: Preparing document...
prince: Converting document...
prince: used font: Pahoran ldsLat, Roman
prince: used font: Pahoran ldsLat, Italic
prince: used font: Pahoran ldsLat, Bold
prince: used font: Pahoran ldsLat, Bold Italic
prince: Finished: success