How to set global font-family in Apache FOP?

Luce Ian picture Luce Ian · Jul 19, 2013 · Viewed 11.1k times · Source

This is what I've used before:

 <fo:block font-family="Tahoma">Text</fo:block>

How can I specify that "Tahoma" is the font-family for the entire document?

I am looking for an equivalent of CSS's

body {
  font-family: "Tahoma";
}

Answer

Michał Krzemiński picture Michał Krzemiński · Aug 2, 2013

If you want to set default font for whole document you can set it in fo:root. It should get inherited by every child-node without specified font-family.

<fo:root font-family="Tahoma">
    <!-- rest of document -->
</fo:root>