Package org.apache.fontbox.cff
Class Type2CharString
java.lang.Object
org.apache.fontbox.cff.Type1CharString
org.apache.fontbox.cff.Type2CharString
- Direct Known Subclasses:
CIDKeyedType2CharString
Represents a Type 2 CharString by converting it into an equivalent Type 1 CharString.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate final intprivate floatprivate int -
Constructor Summary
ConstructorsConstructorDescriptionType2CharString(Type1CharStringReader font, String fontName, String glyphName, int gid, List<Object> sequence, int defaultWidthX, int nomWidthX) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAlternatingCurve(List<Number> numbers, boolean horizontal) private voidaddAlternatingLine(List<Number> numbers, boolean horizontal) private voidaddCommandList(List<List<Number>> numbers, CharStringCommand command) private voidclearStack(List<Number> numbers, boolean flag) private voidprivate voidconvertType1ToType2(List<Object> sequence) Converts a sequence of Type 2 commands into a sequence of Type 1 commands.convertType2Command(List<Number> numbers, CharStringCommand command) private voidexpandStemHints(List<Number> numbers, boolean horizontal) intgetGID()Return the GID (glyph id) of this charstring.private voidmarkPath()Methods inherited from class org.apache.fontbox.cff.Type1CharString
addCommand, getBounds, getLastSequenceEntry, getName, getPath, getWidth, isSequenceEmpty, toString
-
Field Details
-
defWidthX
private float defWidthX -
nominalWidthX
private float nominalWidthX -
pathCount
private int pathCount -
gid
private final int gid
-
-
Constructor Details
-
Type2CharString
public Type2CharString(Type1CharStringReader font, String fontName, String glyphName, int gid, List<Object> sequence, int defaultWidthX, int nomWidthX) Constructor.- Parameters:
font- Parent CFF fontfontName- font nameglyphName- glyph name (or CID as hex string)gid- GIDsequence- Type 2 char string sequencedefaultWidthX- default widthnomWidthX- nominal width
-
-
Method Details
-
getGID
public int getGID()Return the GID (glyph id) of this charstring.- Returns:
- the GID of this charstring
-
convertType1ToType2
Converts a sequence of Type 2 commands into a sequence of Type 1 commands.- Parameters:
sequence- the Type 2 char string sequence
-
convertType2Command
-
clearStack
-
expandStemHints
- Parameters:
numbers-horizontal-
-
markPath
private void markPath() -
closeCharString2Path
private void closeCharString2Path() -
addAlternatingLine
-
addAlternatingCurve
-
addCurve
-
addCommandList
-
split
-