Package org.verapdf.pd.font.cff
Class CFFCIDFontProgram
java.lang.Object
org.verapdf.pd.font.cff.CFFCIDFontProgram
- All Implemented Interfaces:
FontProgram
Instance of this class represent a parser of CIDFont from FontSet of CFF file.
- Author:
- Sergey Shemyakov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected longprotected CFFIndexprotected longprotected intprotected static final float[]protected intprotected CFFIndexprotected float[]protected CFFIndexprotected booleanprotected intprotected intprotected longprotected longprotected SeekableInputStreamprotected longprotected booleanprotected longprotected longprotected Stringprotected CharStringsWidths -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsCID(int cid) Method works only for fonts where cid notation is used.booleancontainsCode(int code) Checks if font contains character with given code.booleancontainsGlyph(String glyphName) Checks if this font program has glyph for given glyph name.protected booleangetGlyphName(int code) Returns glyph name for glyph with given code.intprotected StringgetStringBySID(int sid) intfloatgetWidth(int code) Returns width of glyph for given character code.floatReturns width of glyph for given glyph name.booleanbooleanvoidThis method does parsing of font, after it all the data needed should be extracted.protected intprotected intprotected voidprotected voidprotected CFFIndexprotected CFFNumberprotected voidprotected voidreadTopDictOneByteOps(int lastRead) protected voidreadTopDictTwoByteOps(int lastRead) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.verapdf.pd.font.FontProgram
getFontProgramResource, getWeight
-
Field Details
-
attemptedParsing
protected boolean attemptedParsing -
successfullyParsed
protected boolean successfullyParsed -
DEFAULT_FONT_MATRIX
protected static final float[] DEFAULT_FONT_MATRIX -
stack
-
globalSubrs
-
isSubset
protected boolean isSubset -
privateDictOffset
protected long privateDictOffset -
privateDictSize
protected long privateDictSize -
topDictBeginOffset
protected long topDictBeginOffset -
topDictEndOffset
protected long topDictEndOffset -
fontMatrix
protected float[] fontMatrix -
charStringsOffset
protected long charStringsOffset -
charSetOffset
protected long charSetOffset -
charStringType
protected int charStringType -
weight
-
nGlyphs
protected int nGlyphs -
charStrings
-
widths
-
defaultWidthX
protected int defaultWidthX -
nominalWidthX
protected int nominalWidthX -
subrsOffset
protected long subrsOffset -
source
-
definedNames
-
-
Method Details
-
parseFont
This method does parsing of font, after it all the data needed should be extracted.- Specified by:
parseFontin interfaceFontProgram- Throws:
IOException- if error in font parsing occurs.
-
readTopDictTwoByteOps
- Throws:
IOException
-
getWidth
public float getWidth(int code) Returns width of glyph for given character code.- Specified by:
getWidthin interfaceFontProgram- Parameters:
code- is code for glyph.- Returns:
- width of corresponding glyph or -1 if glyph is not found.
-
getWidth
Returns width of glyph for given glyph name.- Specified by:
getWidthin interfaceFontProgram- Parameters:
glyphName- is name for glyph.- Returns:
- width of corresponding glyph or -1 if glyph is not found.
-
getGlyphName
Description copied from interface:FontProgramReturns glyph name for glyph with given code.- Specified by:
getGlyphNamein interfaceFontProgram- Parameters:
code- is code of glyph.- Returns:
- glyph name.
-
getAscent
- Specified by:
getAscentin interfaceFontProgram
-
getDescent
- Specified by:
getDescentin interfaceFontProgram
-
containsCode
public boolean containsCode(int code) Checks if font contains character with given code.- Specified by:
containsCodein interfaceFontProgram- Parameters:
code- is character code.- Returns:
- true if font contains character with given code.
-
containsGlyph
Description copied from interface:FontProgramChecks if this font program has glyph for given glyph name.- Specified by:
containsGlyphin interfaceFontProgram- Parameters:
glyphName- is the name of glyph.- Returns:
- true if this font program has glyph for given name.
-
containsCID
public boolean containsCID(int cid) Description copied from interface:FontProgramMethod works only for fonts where cid notation is used.- Specified by:
containsCIDin interfaceFontProgram- Returns:
- true if font a is cid font and contains given cid.
-
getSupplement
public int getSupplement() -
getRegistry
-
getOrdering
-
isAttemptedParsing
public boolean isAttemptedParsing()- Specified by:
isAttemptedParsingin interfaceFontProgram- Returns:
- true if font parsing has been attempted.
-
isSuccessfulParsing
public boolean isSuccessfulParsing()- Specified by:
isSuccessfulParsingin interfaceFontProgram- Returns:
- true if font was successfully parsed.
-
getCIDList
- Specified by:
getCIDListin interfaceFontProgram
-
containsROS
protected boolean containsROS() -
readTopDictUnit
- Throws:
IOException
-
readTopDictOneByteOps
protected void readTopDictOneByteOps(int lastRead) -
readCharStrings
- Throws:
IOException
-
readPrivateDictUnit
- Throws:
IOException
-
getNGlyphs
public int getNGlyphs()- Returns:
- amount of glyphs in the font.
-
getFontProgramResource
-
getWeight
-
readCard8
- Throws:
IOException
-
readCard16
- Throws:
IOException
-
readIndex
- Throws:
IOException
-
readHeader
- Throws:
IOException
-
readNumber
- Throws:
IOException
-
getStringBySID
- Throws:
IOException
-