Font and font size for Prince PDF

Can we define Font and Font size while exporting print pdf by Prince.

Hi John,

That should be in “Theme Options” in the PDF section

That should help you define the size of the body text. All of the rest of the text in the book is defined as multiple of the body text. So a heading 1 might be 1.3x the body text and a heading 2 might be 1.2x the size of the body text.

–
Only a couple themes can change the actual font. Pressbooks called this “Shapeshifter” but you can pick your specfic font on the Malala Theme or the McLuhan Theme.

Note that the first screenshot I showed you was from the “Jacobs” theme, but the one below is from the “McLuhan” theme, and here I have a dropdown list of fonts.

1 Like

@beckej Thank You.

We are using McLuhan Theme for generating Print PDF file.

Since the chapter heading changing depending on the body text.

Is there a way I can fix the chapter heading size.

So, first set your body text size the size you want it.

Then you are going to have to write custom CSS to change the size of the headings. In the custom CSS Screen, you can change CSS for Web, for Ebook, or for PDF, so make sure you choose the right one from the drop down menu.

You are going to need to find the existing CSS that makes the headings their size.

For me, the CSS that defines the headings started at line 182.

Then you need to write new CSS in “Your PDF Styles” that will overright Mcluhan’s default:

Something like:
h1 {
font-size: 1.5em;
}

Fonts in em work as a multiplier, where 1 is the default font of your book. If you set your default font as 10 pt, 1.5em would be 15pt font.

If you change one heading, you may want to continue down the page and change multiple headings to make sure they remain large to small.

@beckej Thank you.

What we wanted is the chapter heading size fixed. Do not want to increase the heading size proportionate to body text size.

Example:
Body Text size : 7
Chapter heading size : 8

The problem we are facing is when the chapter heading is longer, the chapter heading becomes multiple lines, this occupies more space in the print book, thus increasing the number of pages.

We are looking for fixed font size for the chapter heading.

Thank you.

Hi John,

I think if you got someone to help you that knew just a little bit of CSS you would be rolling.

For your example, you would set the Body text size to 7px in the theme settings like I showed you, and then you would put some custom css in the other area I showed you.

Something like:
h1, h2, h3, h4, h5 {
font-size: 8px;
}

This is as far as I can take you, but there are some places to get simple css tutorials or good places to search for examples.

@beckej Thank you and it is very much useful and appreciate your response.