Package org.apache.fop.fonts.cff
Class CFFDataReader
java.lang.Object
org.apache.fop.fonts.cff.CFFDataReader
A class to read the CFF data from an OTF CFF font file.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
An object used to hold index data from the CFF dataclass
Parent class which provides the ability to retrieve byte data from a sub-table.class
static class
A class containing data for a dictionary entryclass
class
class
class
class
class
-
Constructor Summary
ConstructorDescriptionCFFDataReader
(byte[] cffDataArray) Constructor for the CFF data reader which accepts the CFF byte data as an argument.CFFDataReader
(FontFileReader fontFile) Constructor for the CFF data reader which accepts a FontFileReader object which points to the original font file as an argument. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.fontbox.cff.CFFDataInput
byte[]
org.apache.fontbox.cff.CFFDataInput
getLocalSubrsForGlyph
(int glyph) getPrivateDict
(CFFDataReader.DICTEntry privateEntry) byte[]
getPrivateDictBytes
(CFFDataReader.DICTEntry privateEntry) int
getSIDFromGID
(int charsetOffset, int gid) Retrieves the SID for the given GID objectparseDictData
(byte[] dictData) Parses the dictionary data and returns a map of objects for each entryParses the char string index from the CFF byte datareadIndex
(int offset) Reads a CFF index object are the specified offset positionreadIndex
(org.apache.fontbox.cff.CFFDataInput input) Reads an index from the current position of the CFFDataInput object
-
Constructor Details
-
CFFDataReader
public CFFDataReader() -
CFFDataReader
Constructor for the CFF data reader which accepts the CFF byte data as an argument.- Parameters:
cffDataArray
- A byte array which holds the CFF data- Throws:
IOException
-
CFFDataReader
Constructor for the CFF data reader which accepts a FontFileReader object which points to the original font file as an argument.- Parameters:
fontFile
- The font file as represented by a FontFileReader object- Throws:
IOException
-
-
Method Details
-
getPrivateDict
public Map<String,CFFDataReader.DICTEntry> getPrivateDict(CFFDataReader.DICTEntry privateEntry) throws IOException - Throws:
IOException
-
getPrivateDictBytes
- Throws:
IOException
-
parseDictData
public LinkedHashMap<String,CFFDataReader.DICTEntry> parseDictData(byte[] dictData) throws IOException Parses the dictionary data and returns a map of objects for each entry- Parameters:
dictData
- The data for the dictionary data- Returns:
- Returns a map of type DICTEntry identified by the operand name
- Throws:
IOException
- Throws an IO Exception if an error occurs
-
readIndex
Reads a CFF index object are the specified offset position- Parameters:
offset
- The position of the index object to read- Returns:
- Returns an object representing the index
- Throws:
IOException
- Throws an IO Exception if an error occurs
-
readIndex
public CFFDataReader.CFFIndexData readIndex(org.apache.fontbox.cff.CFFDataInput input) throws IOException Reads an index from the current position of the CFFDataInput object- Parameters:
input
- The object holding the CFF byte data- Returns:
- Returns an object representing the index
- Throws:
IOException
- Throws an IO Exception if an error occurs
-
getSIDFromGID
Retrieves the SID for the given GID object- Parameters:
charsetOffset
- The offset of the charset datagid
- The GID for which to retrieve the SID- Returns:
- Returns the SID as an integer
- Throws:
IOException
-
getHeader
public byte[] getHeader() -
getNameIndex
-
getTopDictIndex
-
getTopDictEntries
-
getStringIndex
-
getGlobalIndexSubr
-
getLocalIndexSubr
-
getCharStringIndex
-
getCFFData
public org.apache.fontbox.cff.CFFDataInput getCFFData() -
getEncoding
-
getFDSelect
-
getFDFonts
-
getLocalSubrsForGlyph
- Throws:
IOException
-
readCharStringIndex
Parses the char string index from the CFF byte data- Returns:
- Returns the char string index object
- Throws:
IOException
- Throws an IO Exception if an error occurs
-