Package org.apache.fontbox.cff
Class Type2CharStringParser
java.lang.Object
org.apache.fontbox.cff.Type2CharStringParser
This class represents a converter for a mapping into a Type2-sequence.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionType2CharStringParser(String fontName) Constructs a new Type1CharStringParser object for a Type 1-equivalent font. -
Method Summary
Modifier and TypeMethodDescriptionprivate intcalculateSubrNumber(int operand, int subrIndexlength) private intcountNumbers(List<Object> sequence) private intgetMaskLength(int hstemCount, int vstemCount) private byte[]getSubrBytes(byte[][] subrIndex, Type2CharStringParser.GlyphData glyphData) The given byte array will be parsed and converted to a Type2 sequence.private voidparseSequence(byte[] bytes, byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) private voidprocessCallGSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) private voidprocessCallSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) private voidprocessSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, byte[] subrBytes, Type2CharStringParser.GlyphData glyphData) private CharStringCommandreadCommand(int b0, DataInput input, Type2CharStringParser.GlyphData glyphData) private NumberreadNumber(int b0, DataInput input) toString()
-
Field Details
-
CALLSUBR
private static final int CALLSUBR- See Also:
-
CALLGSUBR
private static final int CALLGSUBR- See Also:
-
fontName
-
-
Constructor Details
-
Type2CharStringParser
Constructs a new Type1CharStringParser object for a Type 1-equivalent font.- Parameters:
fontName- font name
-
-
Method Details
-
parse
public List<Object> parse(byte[] bytes, byte[][] globalSubrIndex, byte[][] localSubrIndex, String glyphName) throws IOException The given byte array will be parsed and converted to a Type2 sequence.- Parameters:
bytes- the given mapping as byte arrayglobalSubrIndex- array containing all global subroutineslocalSubrIndex- array containing all local subroutinesglyphName- the name of the current glyph- Returns:
- the Type2 sequence
- Throws:
IOException- if an error occurs during reading
-
parseSequence
private void parseSequence(byte[] bytes, byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) throws IOException - Throws:
IOException
-
getSubrBytes
-
processCallSubr
private void processCallSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) throws IOException - Throws:
IOException
-
processCallGSubr
private void processCallGSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, Type2CharStringParser.GlyphData glyphData) throws IOException - Throws:
IOException
-
processSubr
private void processSubr(byte[][] globalSubrIndex, byte[][] localSubrIndex, byte[] subrBytes, Type2CharStringParser.GlyphData glyphData) throws IOException - Throws:
IOException
-
calculateSubrNumber
private int calculateSubrNumber(int operand, int subrIndexlength) -
readCommand
private CharStringCommand readCommand(int b0, DataInput input, Type2CharStringParser.GlyphData glyphData) throws IOException - Throws:
IOException
-
readNumber
- Throws:
IOException
-
getMaskLength
private int getMaskLength(int hstemCount, int vstemCount) -
countNumbers
-
toString
-