Top Description Fields Constructors Methods
org.apache.fontbox.cff

public Class Type1CharString

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.fontbox.cff.Type2CharString
Imports
java.awt.geom.AffineTransform, .GeneralPath, .Point2D, .Rectangle2D, java.io.IOException, java.util.ArrayList, .List, org.apache.commons.logging.Log, .LogFactory, org.apache.fontbox.cff.CharStringCommand.Type1KeyWord, org.apache.fontbox.encoding.StandardEncoding, org.apache.fontbox.type1.Type1CharStringReader

This class represents and renders a Type 1 CharString.
Authors
Villu Ruusmann, John Hewson

Field Summary

Modifier and TypeField and Description
private int
private Point2D.Float
private final List<Point2D.Float>
private final Type1CharStringReader
private final String
private final String
private boolean
private Point2D.Float
private static final Log
private GeneralPath
private final List<Object>
private int

Constructor Summary

AccessConstructor and Description
public
Type1CharString(Type1CharStringReader
Parent Type 1 CharString font.
font
,
String
Name of the font.
fontName
,
String
Name of the glyph.
glyphName
,
List<Object>
Type 1 char string sequence
sequence
)

Constructs a new Type1CharString object.

protected
Type1CharString(Type1CharStringReader
Parent Type 1 CharString font.
font
,
String
Name of the font.
fontName
,
String
Name of the glyph.
glyphName
)

Constructor for use in subclasses.

Method Summary

Modifier and TypeMethod and Description
protected void
addCommand(List<Number>
the parameters of the command to be added
numbers
,
CharStringCommand
the command to be added
command
)

Add a command to the type1 sequence.

private void
callothersubr(int
OtherSubrs entry number
num
)

Flex (via OtherSubrs)

private void
closeCharString1Path()

Close path.

public Rectangle2D

Returns:

the bounds as Rectangle2D
getBounds
()

Returns the bounds of the renderer path.

protected Object

Returns:

the last entry of the type 1 sequence or null if empty
getLastSequenceEntry
()

Returns the last entry of the underlying type1 sequence.

public String
public GeneralPath

Returns:

the path
getPath
()

Returns the path of the character.

public int

Returns:

the width
getWidth
()

Returns the advance width of the glyph.

private void
protected boolean

Returns:

true if the sequence is empty
isSequenceEmpty
()

Indicates if the underlying type1 sequence is empty.

private void
render()

Renders the Type 1 char string sequence to a GeneralPath.

private void
rlineTo(Number dx, Number dy)

Relative lineto.

private void
rmoveTo(Number dx, Number dy)

Relative moveto.

private void
rrcurveTo(Number dx1, Number dy1, Number dx2, Number dy2, Number dx3, Number dy3)

Relative curveto.

private void
seac(Number asb, Number adx, Number ady, Number bchar, Number achar)

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.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

commandCountback to summary
private int commandCount
currentback to summary
private Point2D.Float current
flexPointsback to summary
private final List<Point2D.Float> flexPoints
fontback to summary
private final Type1CharStringReader font
fontNameback to summary
private final String fontName
glyphNameback to summary
private final String glyphName
isFlexback to summary
private boolean isFlex
leftSideBearingback to summary
private Point2D.Float leftSideBearing
LOGback to summary
private static final Log LOG
pathback to summary
private GeneralPath path
type1Sequenceback to summary
private final List<Object> type1Sequence
widthback to summary
private int width

Constructor Detail

Type1CharStringback to summary
public Type1CharString(Type1CharStringReader font, String fontName, String glyphName, List<Object> sequence)

Constructs a new Type1CharString object.

Parameters
font:Type1CharStringReader

Parent Type 1 CharString font.

fontName:String

Name of the font.

glyphName:String

Name of the glyph.

sequence:List<Object>

Type 1 char string sequence

Type1CharStringback to summary
protected Type1CharString(Type1CharStringReader font, String fontName, String glyphName)

Constructor for use in subclasses.

Parameters
font:Type1CharStringReader

Parent Type 1 CharString font.

fontName:String

Name of the font.

glyphName:String

Name of the glyph.

Method Detail

addCommandback to summary
protected void addCommand(List<Number> numbers, CharStringCommand command)

Add a command to the type1 sequence.

Parameters
numbers:List<Number>

the parameters of the command to be added

command:CharStringCommand

the command to be added

callothersubrback to summary
private void callothersubr(int num)

Flex (via OtherSubrs)

Parameters
num:int

OtherSubrs entry number

closeCharString1Pathback to summary
private void closeCharString1Path()

Close path.

getBoundsback to summary
public Rectangle2D getBounds()

Returns the bounds of the renderer path.

Returns:Rectangle2D

the bounds as Rectangle2D

getLastSequenceEntryback to summary
protected Object getLastSequenceEntry()

Returns the last entry of the underlying type1 sequence.

Returns:Object

the last entry of the type 1 sequence or null if empty

getNameback to summary
public String getName()
getPathback to summary
public GeneralPath getPath()

Returns the path of the character.

Returns:GeneralPath

the path

getWidthback to summary
public int getWidth()

Returns the advance width of the glyph.

Returns:int

the width

handleType1Commandback to summary
private void handleType1Command(List<Number> numbers, CharStringCommand command)
isSequenceEmptyback to summary
protected boolean isSequenceEmpty()

Indicates if the underlying type1 sequence is empty.

Returns:boolean

true if the sequence is empty

renderback to summary
private void render()

Renders the Type 1 char string sequence to a GeneralPath.

rlineToback to summary
private void rlineTo(Number dx, Number dy)

Relative lineto.

rmoveToback to summary
private void rmoveTo(Number dx, Number dy)

Relative moveto.

rrcurveToback to summary
private void rrcurveTo(Number dx1, Number dy1, Number dx2, Number dy2, Number dx3, Number dy3)

Relative curveto.

seacback to summary
private void seac(Number asb, Number adx, Number ady, Number bchar, Number achar)

Standard Encoding Accented Character Makes an accented character from two other characters.

setcurrentpointback to summary
private void setcurrentpoint(Number x, Number y)

Sets the current absolute point without performing a moveto. Used only with results from callothersubr

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override