getDefaultFontName/setDefaultFontName

Demonstrates how to specify what font to substitute for a missing font during rendering.

Document doc = new Document(getMyDir() + "Rendering.doc");
// If the default font defined here cannot be found during rendering then the closest font on the machine is used instead.
FontSettings.getDefaultInstance().getSubstitutionSettings().getDefaultFontSubstitution().setDefaultFontName("Arial Unicode MS");
// Now the set default font is used in place of any missing fonts during any rendering calls.
doc.save(getArtifactsDir() + "Rendering.SetDefaultFont.pdf");
doc.save(getArtifactsDir() + "Rendering.SetDefaultFont.xps");