Top Description Methods
org.apache.pdfbox.pdmodel.font

public Interface FontMapper

Known Direct Implementers
org.apache.pdfbox.pdmodel.font.FontMapperImpl
Imports
org.apache.fontbox.FontBoxFont, org.apache.fontbox.ttf.TrueTypeFont

Font mapper, locates non-embedded fonts. If you implement this then you're responsible for caching the fonts. SoftReference<FontBoxFont> is recommended.
Author
John Hewson

Method Summary

Modifier and TypeMethod and Description
public CIDFontMapping

Returns:

the mapped CIDFont font or null
getCIDFont
(String
PostScript name of the mapped font
baseFont
,
PDFontDescriptor
FontDescriptor
fontDescriptor
,
PDCIDSystemInfo
the CID system info, e.g. "Adobe-Japan1", if any.
cidSystemInfo
)

Finds a CFF CID-Keyed font with the given PostScript name, or a suitable substitute, or null.

public FontMapping<FontBoxFont>

Returns:

the mapped FontBox font or null
getFontBoxFont
(String
PostScript name of the mapped font
baseFont
,
PDFontDescriptor
the FontDescriptor of the font to find
fontDescriptor
)

Finds a font with the given PostScript name, or a suitable substitute, or null.

public FontMapping<TrueTypeFont>

Returns:

the mapped TrueType font or null
getTrueTypeFont
(String
PostScript name of the mapped font
baseFont
,
PDFontDescriptor
FontDescriptor
fontDescriptor
)

Finds a TrueType font with the given PostScript name, or a suitable substitute, or null.

Method Detail

getCIDFontback to summary
public CIDFontMapping getCIDFont(String baseFont, PDFontDescriptor fontDescriptor, PDCIDSystemInfo cidSystemInfo)

Finds a CFF CID-Keyed font with the given PostScript name, or a suitable substitute, or null. This method can also map CJK fonts via their CIDSystemInfo (ROS).

Parameters
baseFont:String

PostScript name of the mapped font

fontDescriptor:PDFontDescriptor

FontDescriptor

cidSystemInfo:PDCIDSystemInfo

the CID system info, e.g. "Adobe-Japan1", if any.

Returns:CIDFontMapping

the mapped CIDFont font or null

getFontBoxFontback to summary
public FontMapping<FontBoxFont> getFontBoxFont(String baseFont, PDFontDescriptor fontDescriptor)

Finds a font with the given PostScript name, or a suitable substitute, or null. This allows any font to be substituted with a PFB, TTF or OTF.

Parameters
baseFont:String

PostScript name of the mapped font

fontDescriptor:PDFontDescriptor

the FontDescriptor of the font to find

Returns:FontMapping<FontBoxFont>

the mapped FontBox font or null

getTrueTypeFontback to summary
public FontMapping<TrueTypeFont> getTrueTypeFont(String baseFont, PDFontDescriptor fontDescriptor)

Finds a TrueType font with the given PostScript name, or a suitable substitute, or null.

Parameters
baseFont:String

PostScript name of the mapped font

fontDescriptor:PDFontDescriptor

FontDescriptor

Returns:FontMapping<TrueTypeFont>

the mapped TrueType font or null