| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | FontMapperImpl.
A potential match for a font substitution. |
| Modifier and Type | Field and Description |
|---|---|
| private static final FontCache | |
| private Map | |
| private FontProvider | |
| private final TrueTypeFont | |
| private static final Log | |
| private final Map | substitutes
Map of PostScript name substitutes, in priority order. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSubstitute(String
PostScript name of the font to match match, String PostScript name of the font to use as a replacement replace)Adds a top-priority substitute for the given font. |
| private void | |
| private Map | |
| private FontBoxFont | findFont(FontFormat format, String
PostScript font name postScriptName)Finds a font with the given PostScript name, or a suitable substitute, or null. |
| private FontBoxFont | findFontBoxFont(String
PostScript font name postScriptName)Finds a font with the given PostScript name, or a suitable substitute, or null. |
| public CIDFontMapping | getCIDFont(String
PostScript name of the mapped font baseFont, PDFontDescriptor FontDescriptor fontDescriptor, PDCIDSystemInfo the CID system info, e.g. "Adobe-Japan1", if any. cidSystemInfo)Implements org. Finds a CFF CID-Keyed font with the given PostScript name, or a suitable substitute, or null. |
| private String | getFallbackFontName(PDFontDescriptor fontDescriptor)
Attempts to find a good fallback based on the font descriptor. |
| private FontInfo | |
| public FontMapping | getFontBoxFont(String
PostScript name of the mapped font baseFont, PDFontDescriptor the FontDescriptor of the font to find fontDescriptor)Implements org. Finds a font with the given PostScript name, or a suitable substitute, or null. |
| public FontCache | |
| private PriorityQueue | getFontMatches(PDFontDescriptor
FontDescriptor, always present. fontDescriptor, PDCIDSystemInfo Font's CIDSystemInfo, may be null. cidSystemInfo)Returns a list of matching fonts, scored by suitability. |
| private Set | getPostScriptNames(String postScriptName)
Gets alternative names, as seen in some PDFs, e.g. PDFBOX-142. |
| public synchronized FontProvider | |
| private List | |
| public FontMapping | getTrueTypeFont(String
PostScript name of the mapped font baseFont, PDFontDescriptor FontDescriptor fontDescriptor)Implements org. Finds a TrueType font with the given PostScript name, or a suitable substitute, or null. |
| private boolean | isCharSetMatch(PDCIDSystemInfo cidSystemInfo, FontInfo info)
Returns true if the character set described by CIDSystemInfo is present in the given font. |
| private FontMapperImpl. | |
| private boolean | |
| public synchronized void |
| fontCache | back to summary |
|---|---|
| private static final FontCache fontCache | |
| fontInfoByName | back to summary |
|---|---|
| private Map<String, FontInfo> fontInfoByName | |
| fontProvider | back to summary |
|---|---|
| private FontProvider fontProvider | |
| lastResortFont | back to summary |
|---|---|
| private final TrueTypeFont lastResortFont | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| substitutes | back to summary |
|---|---|
| private final Map<String, List<String>> substitutes Map of PostScript name substitutes, in priority order. | |
| FontMapperImpl | back to summary |
|---|---|
| pack-priv FontMapperImpl() | |
| addSubstitute | back to summary |
|---|---|
| public void addSubstitute(String match, String replace) Adds a top-priority substitute for the given font. | |
| addSubstitutes | back to summary |
|---|---|
| private void addSubstitutes(String match, List<String> replacements) | |
| createFontInfoByName | back to summary |
|---|---|
| private Map | |
| findFont | back to summary |
|---|---|
| private FontBoxFont findFont(FontFormat format, String postScriptName) Finds a font with the given PostScript name, or a suitable substitute, or null.
| |
| findFontBoxFont | back to summary |
|---|---|
| private FontBoxFont findFontBoxFont(String postScriptName) Finds a font with the given PostScript name, or a suitable substitute, or null.
| |
| getCIDFont | back to summary |
|---|---|
| public CIDFontMapping getCIDFont(String baseFont, PDFontDescriptor fontDescriptor, PDCIDSystemInfo cidSystemInfo) Implements org. 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).
| |
| getFallbackFontName | back to summary |
|---|---|
| private String getFallbackFontName(PDFontDescriptor fontDescriptor) Attempts to find a good fallback based on the font descriptor. | |
| getFont | back to summary |
|---|---|
| private FontInfo getFont(FontFormat format, String postScriptName) Finds the named font with the given format. | |
| getFontBoxFont | back to summary |
|---|---|
| public FontMapping Implements org. 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.
| |
| getFontCache | back to summary |
|---|---|
| public FontCache getFontCache() Returns the font cache associated with this FontMapper. This method is needed by FontProvider subclasses. | |
| getFontMatches | back to summary |
|---|---|
| private PriorityQueue Returns a list of matching fonts, scored by suitability. Positive scores indicate matches for certain attributes, while negative scores indicate mismatches. Zero scores are neutral.
| |
| getPostScriptNames | back to summary |
|---|---|
| private Set Gets alternative names, as seen in some PDFs, e.g. PDFBOX-142. | |
| getProvider | back to summary |
|---|---|
| public synchronized FontProvider getProvider() Returns the font service provider. Defaults to using FileSystemFontProvider. | |
| getSubstitutes | back to summary |
|---|---|
| private List Returns the substitutes for a given font. | |
| getTrueTypeFont | back to summary |
|---|---|
| public FontMapping Implements org. Finds a TrueType font with the given PostScript name, or a suitable substitute, or null.
| |
| isCharSetMatch | back to summary |
|---|---|
| private boolean isCharSetMatch(PDCIDSystemInfo cidSystemInfo, FontInfo info) Returns true if the character set described by CIDSystemInfo is present in the given font. Only applies to Adobe-GB1, Adobe-CNS1, Adobe-Japan1, Adobe-Korea1, as per the PDF spec. | |
| printMatches | back to summary |
|---|---|
| private FontMapperImpl. For debugging. Prints all matches and returns the best match. | |
| probablyBarcodeFont | back to summary |
|---|---|
| private boolean probablyBarcodeFont(PDFontDescriptor fontDescriptor) | |
| setProvider | back to summary |
|---|---|
| public synchronized void setProvider(FontProvider fontProvider) Sets the font service provider. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final FontProvider |
| Access | Constructor and Description |
|---|---|
| private |
| INSTANCE | back to summary |
|---|---|
| private static final FontProvider INSTANCE | |
| DefaultFontProvider | back to summary |
|---|---|
| private DefaultFontProvider() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final FontInfo | |
| pack-priv double |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(FontMapperImpl.
the object to be compared. matchImplements java. Compares this object with the specified object for order. |
| info | back to summary |
|---|---|
| pack-priv final FontInfo info | |
| score | back to summary |
|---|---|
| pack-priv double score | |
| FontMatch | back to summary |
|---|---|
| pack-priv FontMatch(FontInfo info) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(FontMapperImpl. Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |