Package org.apache.pdfbox.pdmodel.font
Interface FontMapper
-
- All Known Implementing Classes:
FontMapperImpl
public interface FontMapperFont mapper, locates non-embedded fonts. If you implement this then you're responsible for caching the fonts. SoftReference<FontBoxFont> is recommended.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CIDFontMappinggetCIDFont(java.lang.String baseFont, PDFontDescriptor fontDescriptor, PDCIDSystemInfo cidSystemInfo)Finds a CFF CID-Keyed font with the given PostScript name, or a suitable substitute, or null.FontMapping<FontBoxFont>getFontBoxFont(java.lang.String baseFont, PDFontDescriptor fontDescriptor)Finds a font with the given PostScript name, or a suitable substitute, or null.FontMapping<TrueTypeFont>getTrueTypeFont(java.lang.String baseFont, PDFontDescriptor fontDescriptor)Finds a TrueType font with the given PostScript name, or a suitable substitute, or null.
-
-
-
Method Detail
-
getTrueTypeFont
FontMapping<TrueTypeFont> getTrueTypeFont(java.lang.String baseFont, PDFontDescriptor fontDescriptor)
Finds a TrueType font with the given PostScript name, or a suitable substitute, or null.- Parameters:
baseFont- PostScript name of the mapped fontfontDescriptor- FontDescriptor- Returns:
- the mapped TrueType font or null
-
getFontBoxFont
FontMapping<FontBoxFont> getFontBoxFont(java.lang.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- PostScript name of the mapped fontfontDescriptor- the FontDescriptor of the font to find- Returns:
- the mapped FontBox font or null
-
getCIDFont
CIDFontMapping getCIDFont(java.lang.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- PostScript name of the mapped fontfontDescriptor- FontDescriptorcidSystemInfo- the CID system info, e.g. "Adobe-Japan1", if any.- Returns:
- the mapped CIDFont font or null
-
-