ceTe Software Help Library for Java August - 2020
DynamicPDF Generator for Java / Programming with Generator for Java / Fonts And Text / Core Fonts
In This Topic
    Core Fonts
    In This Topic

    PDF specifies 14 fonts that are guaranteed to be included with any PDF viewer. As a result, these fonts do not need to be embedded into a PDF document when it is created. The 14 core PDF fonts are accessed through static properties on the Font class:

    • Font.getTimesRoman() - Times Roman (Times New Roman)
    • Font.getTimesBold() - Times (Times New Roman) Bold
    • Font.getTimesItalic() - Times (Times New Roman) Italic
    • Font.getTimesBoldItalic() - Times (Times New Roman) Bold Italic
    • Font.getHelvetica() - Helvetica (Arial)
    • Font.getHelveticaBold() - Helvetica (Arial) Bold
    • Font.getHelveticaOblique() - Helvetica (Arial) Oblique
    • Font.getHelveticaBoldOblique() - Helvetica (Arial) Bold Oblique
    • Font.getCourier() - Courier
    • Font.getCourierBold() - Courier Bold
    • Font.getCourierOblique() - Courier Oblique
    • Font.getCourierBoldOblique() - Courier Bold Oblique
    • Font.getSymbol() - SymbolFont.getZapfDingbats() - Zapf Dingbats

    A core font can be used as follows:

    [Java]
        // Use a core font in a text area Page Element.
        page1.getElements().add(new TextArea("Text", 0, 0, 200, 12, Font.getTimesRoman(), 12));
    

     

    NOTE: Helvetica is equivalent to the Arial TrueType font included on Windows systems, and Times is equivalent to the Times New Roman TrueType font included on Windows systems. It is much more efficient to use the equivalent core fonts whenever possible. 

    See Also