More Resources
Table of Contents
More Resources
Adding Custom Fonts to the XML

Edit the XML document to include the custom fonts.
You want to tell the DITA build file that you want to use new fonts when creating PDFs.
  1. Open the font-mappings.xml file (located in cfg/fo/ folder) within your DITA-OT install.
  2. Add a new logical-font attribute for the custom font. This element should be next to the other logical-font definitions within the < font-table> tag.

    Step Information
    Tip:You can add as many of these new logical-fonts as you want, as long as they have distinct names.

    Example
    < logical-font name="{font_description}"> 
    	< physical-font char-set="default"> 
    		< font-face> {font-face_name}< /font-face> 
    	< /physical-font> 
    < /logical-font> 

  3. Fill in {font_description} with a recognizeable name for the font that you can use in the xsl stylesheets.
  4. Fill in {font-face_name} with the correct font name.

    1. If you’re testing fonts locally, use the name in Finding Font Names.
    2. If you’re compiling your font with your plugin, use the “font-face_name” value that you added to your custom fop.xconf file in Creating a Custom fop Configuration.
  5. (Optional) You can also change the default fonts by going into the logical-font name=”Sans” (for headers) and name=”Serif” (for body) and changing the char-set=”default” font-face to the (font-face_name) in Step 4.
  6. Open your catalog.xml file and double check that it is referencing your font-mappings file.
DITA recognizes these new fonts. Now, you’ll need to look at Editing the XSL Stylesheet.
Note:If you change the defaults (Step 5), you don’t need to edit the custom.xsl.xsl file. For more information, see Editing the XSL Stylesheet.