Package org.apache.pdfbox.pdmodel.font
Class FileSystemFontProvider.FSFontInfo
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.font.FontInfo
-
- org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.FSFontInfo
-
- Enclosing class:
- FileSystemFontProvider
private static class FileSystemFontProvider.FSFontInfo extends FontInfo
-
-
Field Summary
Fields Modifier and Type Field Description private CIDSystemInfocidSystemInfoprivate java.io.Filefileprivate FontFormatformatprivate java.lang.Stringhashprivate longlastModifiedprivate intmacStyleprivate PDPanoseClassificationpanoseprivate FileSystemFontProviderparentprivate java.lang.StringpostScriptNameprivate intsFamilyClassprivate intulCodePageRange1private intulCodePageRange2private intusWeightClass
-
Constructor Summary
Constructors Modifier Constructor Description privateFSFontInfo(java.io.File file, FontFormat format, java.lang.String postScriptName, CIDSystemInfo cidSystemInfo, int usWeightClass, int sFamilyClass, int ulCodePageRange1, int ulCodePageRange2, int macStyle, byte[] panose, FileSystemFontProvider parent, java.lang.String hash, long lastModified)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CIDSystemInfogetCIDSystemInfo()Returns the CIDSystemInfo associated with the font, if present.intgetCodePageRange1()Returns the ulCodePageRange1 field of the "OS/2" table, or 0.intgetCodePageRange2()Returns the ulCodePageRange2 field of the "OS/2" table, or 0.intgetFamilyClass()Returns the sFamilyClass field of the "OS/2" table, or -1.FontBoxFontgetFont()Returns a new FontBox font instance for the font.FontFormatgetFormat()Returns the font's format.intgetMacStyle()Returns the macStyle field of the "head" table, or -1.private OpenTypeFontgetOTFFont(java.lang.String postScriptName, java.io.File file)PDPanoseClassificationgetPanose()Returns the Panose classification of the font, if any.java.lang.StringgetPostScriptName()Returns the PostScript name of the font.private TrueTypeFontgetTrueTypeFont(java.lang.String postScriptName, java.io.File file)private Type1FontgetType1Font(java.lang.String postScriptName, java.io.File file)intgetWeightClass()Returns the usWeightClass field of the "OS/2" table, or -1.private TrueTypeFontreadTrueTypeFont(java.lang.String postScriptName, java.io.File file)java.lang.StringtoString()-
Methods inherited from class org.apache.pdfbox.pdmodel.font.FontInfo
getCodePageRange, getWeightClassAsPanose
-
-
-
-
Field Detail
-
postScriptName
private final java.lang.String postScriptName
-
format
private final FontFormat format
-
cidSystemInfo
private final CIDSystemInfo cidSystemInfo
-
usWeightClass
private final int usWeightClass
-
sFamilyClass
private final int sFamilyClass
-
ulCodePageRange1
private final int ulCodePageRange1
-
ulCodePageRange2
private final int ulCodePageRange2
-
macStyle
private final int macStyle
-
panose
private final PDPanoseClassification panose
-
file
private final java.io.File file
-
parent
private final FileSystemFontProvider parent
-
hash
private final java.lang.String hash
-
lastModified
private final long lastModified
-
-
Constructor Detail
-
FSFontInfo
private FSFontInfo(java.io.File file, FontFormat format, java.lang.String postScriptName, CIDSystemInfo cidSystemInfo, int usWeightClass, int sFamilyClass, int ulCodePageRange1, int ulCodePageRange2, int macStyle, byte[] panose, FileSystemFontProvider parent, java.lang.String hash, long lastModified)
-
-
Method Detail
-
getPostScriptName
public java.lang.String getPostScriptName()
Description copied from class:FontInfoReturns the PostScript name of the font.- Specified by:
getPostScriptNamein classFontInfo- Returns:
- the PostScript name of the font
-
getFormat
public FontFormat getFormat()
Description copied from class:FontInfoReturns the font's format.
-
getCIDSystemInfo
public CIDSystemInfo getCIDSystemInfo()
Description copied from class:FontInfoReturns the CIDSystemInfo associated with the font, if present.- Specified by:
getCIDSystemInfoin classFontInfo- Returns:
- the CIDSystemInfo of the font if any
-
getFont
public FontBoxFont getFont()
Returns a new FontBox font instance for the font. Implementors of this method must not cache the return value of this method unless doing so via the currentFontCache.The method returns null if there was an error opening the font.
-
getFamilyClass
public int getFamilyClass()
Description copied from class:FontInfoReturns the sFamilyClass field of the "OS/2" table, or -1.- Specified by:
getFamilyClassin classFontInfo- Returns:
- the FamilyClass of the font
-
getWeightClass
public int getWeightClass()
Description copied from class:FontInfoReturns the usWeightClass field of the "OS/2" table, or -1.- Specified by:
getWeightClassin classFontInfo- Returns:
- the WeightClass of the font
-
getCodePageRange1
public int getCodePageRange1()
Description copied from class:FontInfoReturns the ulCodePageRange1 field of the "OS/2" table, or 0.- Specified by:
getCodePageRange1in classFontInfo- Returns:
- the CodePageRange1 of the font if present
-
getCodePageRange2
public int getCodePageRange2()
Description copied from class:FontInfoReturns the ulCodePageRange2 field of the "OS/2" table, or 0.- Specified by:
getCodePageRange2in classFontInfo- Returns:
- the CodePageRange2 of the font if present
-
getMacStyle
public int getMacStyle()
Description copied from class:FontInfoReturns the macStyle field of the "head" table, or -1.- Specified by:
getMacStylein classFontInfo- Returns:
- the MacStyle of the font
-
getPanose
public PDPanoseClassification getPanose()
Description copied from class:FontInfoReturns the Panose classification of the font, if any.
-
getTrueTypeFont
private TrueTypeFont getTrueTypeFont(java.lang.String postScriptName, java.io.File file)
-
readTrueTypeFont
private TrueTypeFont readTrueTypeFont(java.lang.String postScriptName, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
getOTFFont
private OpenTypeFont getOTFFont(java.lang.String postScriptName, java.io.File file)
-
getType1Font
private Type1Font getType1Font(java.lang.String postScriptName, java.io.File file)
-
-