Package org.verapdf.pd.font.type1
Class Type1CharStringParser
java.lang.Object
org.verapdf.pd.font.type1.BaseCharStringParser
org.verapdf.pd.font.type1.Type1CharStringParser
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
ConstructorsConstructorDescriptionType1CharStringParser(ASInputStream decodedCharString) Type1CharStringParser(ASInputStream decodedCharString, Map<Integer, CFFNumber> subrWidths) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprocessNextOperator(int firstByte) This method processes charstring-encoded operators.protected CFFNumberreadNextNumber(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 Details
-
Type1CharStringParser
- Throws:
IOException
-
Type1CharStringParser
public Type1CharStringParser(ASInputStream decodedCharString, Map<Integer, CFFNumber> subrWidths) throws IOException- Throws:
IOException
-
-
Method Details
-
processNextOperator
This method processes charstring-encoded operators. It should set width when it can be determined. Methods returns true if width is calculated.- Specified by:
processNextOperatorin 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
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:
readNextNumberin classBaseCharStringParser- Returns:
- number that was read.
- Throws:
IOException- if stream reading error occurs.
-