Package org.verapdf.pd.font.type1
Class Type1CharStringParser
- java.lang.Object
-
- org.verapdf.pd.font.type1.BaseCharStringParser
-
- org.verapdf.pd.font.type1.Type1CharStringParser
-
public class Type1CharStringParser extends BaseCharStringParser
This class parses charstring data in font Type 1 files after it was eexec-decoded. In particular, it extracts glyph width info.- Author:
- Sergey Shemyakov
-
-
Field Summary
-
Fields inherited from class org.verapdf.pd.font.type1.BaseCharStringParser
bias, gBias, globalSubrs, localSubrs, stack, subrWidths
-
-
Constructor Summary
Constructors Constructor Description Type1CharStringParser(ASInputStream decodedCharString)
Type1CharStringParser(ASInputStream decodedCharString, Map<Integer,CFFNumber> subrWidths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
processNextOperator(int firstByte)
This method processes charstring-encoded operators.protected CFFNumber
readNextNumber(int firstByte)
This method reads next bytes from stream and interprets them as one number.-
Methods inherited from class org.verapdf.pd.font.type1.BaseCharStringParser
addStream, getWidth, popStack, readStreams, setWidth
-
-
-
-
Constructor Detail
-
Type1CharStringParser
public Type1CharStringParser(ASInputStream decodedCharString) throws IOException
- Throws:
IOException
-
Type1CharStringParser
public Type1CharStringParser(ASInputStream decodedCharString, Map<Integer,CFFNumber> subrWidths) throws IOException
- Throws:
IOException
-
-
Method Detail
-
processNextOperator
protected boolean processNextOperator(int firstByte) throws IOException
This method processes charstring-encoded operators. It should set width when it can be determined. Methods returns true if width is calculated.- Specified by:
processNextOperator
in classBaseCharStringParser
- Parameters:
firstByte
- is first byte of operator. Note that this byte is already read.- Returns:
- true if width was extracted from processed operator.
- Throws:
IOException
- if stream reading error occurs.
-
readNextNumber
protected CFFNumber readNextNumber(int firstByte) throws IOException
This method reads next bytes from stream and interprets them as one number. In Type 1 CharStrings and Type 2 CharStrings this is done a little differently.- Specified by:
readNextNumber
in classBaseCharStringParser
- Returns:
- number that was read.
- Throws:
IOException
- if stream reading error occurs.
-
-