Package org.apache.pdfbox.pdmodel.font
Class Standard14Fonts
java.lang.Object
org.apache.pdfbox.pdmodel.font.Standard14Fonts
The "Standard 14" PDF fonts, also known as the "base 14" fonts.
There are 14 font files, but Acrobat uses additional names for compatibility, e.g. Arial.
- Author:
- John Hewson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for the names of the 14 standard fonts. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsName(String fontName) Returns true if the given font name is one of the known names, including alias.static org.apache.fontbox.afm.FontMetricsReturns the metrics for font specified by fontName.static GeneralPathgetGlyphPath(Standard14Fonts.FontName baseName, String glyphName) Returns the path for the character with the given name for the specified Standard 14 font.static Standard14Fonts.FontNamegetMappedFontName(String fontName) Returns the base name of the font which the given font name maps to.getNames()Returns the set of known font names, including aliases.
-
Method Details
-
getAFM
Returns the metrics for font specified by fontName. Loads the font metrics if not already loaded.- Parameters:
fontName- name of font; either a base name or alias- Returns:
- the font metrics or null if the name is not one of the known names
- Throws:
IllegalArgumentException- if no metrics exist for that font.
-
containsName
Returns true if the given font name is one of the known names, including alias.- Parameters:
fontName- the name of font, either a base name or alias- Returns:
- true if the name is one of the known names
-
getNames
Returns the set of known font names, including aliases.- Returns:
- the set of known font names
-
getMappedFontName
Returns the base name of the font which the given font name maps to.- Parameters:
fontName- name of font, either a base name or an alias- Returns:
- the base name or null if this is not one of the known names
-
getGlyphPath
public static GeneralPath getGlyphPath(Standard14Fonts.FontName baseName, String glyphName) throws IOException Returns the path for the character with the given name for the specified Standard 14 font. The mapped font is cached. The path may differ in different environments as it depends on the mapped font.- Parameters:
baseName- name of the standard 14 fontglyphName- name of glyph- Returns:
- the mapped font
- Throws:
IOException- if the data could not be read
-