Package org.apache.fontbox.cff
Class Type1CharString
java.lang.Object
org.apache.fontbox.cff.Type1CharString
- Direct Known Subclasses:
Type2CharString
This class represents and renders a Type 1 CharString.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
private Point2D.Float
private final List<Point2D.Float>
private Type1CharStringReader
private final String
private final String
private boolean
private Point2D.Float
private static final org.apache.commons.logging.Log
private GeneralPath
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Type1CharString
(Type1CharStringReader font, String fontName, String glyphName) Constructor for use in subclasses.Type1CharString
(Type1CharStringReader font, String fontName, String glyphName, List<Object> sequence) Constructs a new Type1CharString object. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
callothersubr
(int num) Flex (via OtherSubrs)private void
Close path.Returns the bounds of the renderer path.getName()
getPath()
Returns the path of the character.Returns the Type 1 char string sequence.int
getWidth()
Returns the advance width of the glyph.handleCommand
(List<Number> numbers, CharStringCommand command) private void
render()
Renders the Type 1 char string sequence to a GeneralPath.private void
Relative lineto.private void
Relative moveto.private void
Relative curveto.private void
Standard Encoding Accented Character Makes an accented character from two other characters.private void
setcurrentpoint
(Number x, Number y) Sets the current absolute point without performing a moveto.toString()
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
font
-
fontName
-
glyphName
-
path
-
width
private int width -
leftSideBearing
-
current
-
isFlex
private boolean isFlex -
flexPoints
-
type1Sequence
-
commandCount
protected int commandCount
-
-
Constructor Details
-
Type1CharString
public Type1CharString(Type1CharStringReader font, String fontName, String glyphName, List<Object> sequence) Constructs a new Type1CharString object.- Parameters:
font
- Parent Type 1 CharString font.fontName
- Name of the font.glyphName
- Name of the glyph.sequence
- Type 1 char string sequence
-
Type1CharString
Constructor for use in subclasses.- Parameters:
font
- Parent Type 1 CharString font.fontName
- Name of the font.glyphName
- Name of the glyph.
-
-
Method Details
-
getName
-
getBounds
Returns the bounds of the renderer path.- Returns:
- the bounds as Rectangle2D
-
getWidth
public int getWidth()Returns the advance width of the glyph.- Returns:
- the width
-
getPath
Returns the path of the character.- Returns:
- the path
-
getType1Sequence
Returns the Type 1 char string sequence.- Returns:
- the Type 1 sequence
-
render
private void render()Renders the Type 1 char string sequence to a GeneralPath. -
handleCommand
-
setcurrentpoint
Sets the current absolute point without performing a moveto. Used only with results from callothersubr -
callothersubr
private void callothersubr(int num) Flex (via OtherSubrs)- Parameters:
num
- OtherSubrs entry number
-
rmoveTo
Relative moveto. -
rlineTo
Relative lineto. -
rrcurveTo
Relative curveto. -
closeCharString1Path
private void closeCharString1Path()Close path. -
seac
Standard Encoding Accented Character Makes an accented character from two other characters.- Parameters:
asb
-
-
toString
-