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

public Class GlyfSimpleDescript

extends GlyfDescript
Class Inheritance
Imports
java.io.IOException, org.apache.commons.logging.Log, .LogFactory

This class is based on code from Apache Batik a subproject of Apache XMLGraphics. see http://xmlgraphics.apache.org/batik/ for further details.

Field Summary

Modifier and TypeField and Description
private int[]
private byte[]
private static final Log
LOG

Log instance.

private final int
private short[]
private short[]
Inherited from org.apache.fontbox.ttf.GlyfDescript:
ON_CURVEREPEATX_DUALX_SHORT_VECTORY_DUALY_SHORT_VECTOR

Constructor Summary

AccessConstructor and Description
pack-priv
GlyfSimpleDescript()

Constructor for an empty description.

pack-priv
GlyfSimpleDescript(short
number of contours
numberOfContours
,
TTFDataStream
the stream to be read
bais
,
short
the initial X-position
x0
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public int
getEndPtOfContours(int
the number of the contour
i
)

Implements org.apache.fontbox.ttf.GlyphDescription.getEndPtOfContours.

Returns the index of the ending point of the given contour.

public byte
getFlags(int
the given point
i
)

Implements org.apache.fontbox.ttf.GlyphDescription.getFlags.

Returns the flags of the given point.

public int
getPointCount()

Implements org.apache.fontbox.ttf.GlyphDescription.getPointCount.

Returns the number of points.

public short
getXCoordinate(int
the given point
i
)

Implements org.apache.fontbox.ttf.GlyphDescription.getXCoordinate.

Returns the x coordinate of the given point.

public short
getYCoordinate(int
the given point
i
)

Implements org.apache.fontbox.ttf.GlyphDescription.getYCoordinate.

Returns the y coordinate of the given point.

public boolean
isComposite()

Implements org.apache.fontbox.ttf.GlyphDescription.isComposite.

Returns whether this point is a composite or not.

private void
readCoords(int count, TTFDataStream bais, short x0)

The table is stored as relative values, but we'll store them as absolutes.

private void
readFlags(int flagCount, TTFDataStream bais)

The flags are run-length encoded.

Inherited from org.apache.fontbox.ttf.GlyfDescript:
getContourCountgetInstructionsreadInstructionsresolve

Field Detail

endPtsOfContoursback to summary
private int[] endPtsOfContours
flagsback to summary
private byte[] flags
LOGback to summary
private static final Log LOG

Log instance.

pointCountback to summary
private final int pointCount
xCoordinatesback to summary
private short[] xCoordinates
yCoordinatesback to summary
private short[] yCoordinates

Constructor Detail

GlyfSimpleDescriptback to summary
pack-priv GlyfSimpleDescript()

Constructor for an empty description.

GlyfSimpleDescriptback to summary
pack-priv GlyfSimpleDescript(short numberOfContours, TTFDataStream bais, short x0) throws IOException

Constructor.

Parameters
numberOfContours:short

number of contours

bais:TTFDataStream

the stream to be read

x0:short

the initial X-position

Exceptions
IOException:
is thrown if something went wrong

Method Detail

getEndPtOfContoursback to summary
public int getEndPtOfContours(int i)

Implements org.apache.fontbox.ttf.GlyphDescription.getEndPtOfContours.

Doc from org.apache.fontbox.ttf.GlyphDescription.getEndPtOfContours.

Returns the index of the ending point of the given contour.

Parameters
i:int

the number of the contour

Returns:int

the index of the ending point of the given contour

Annotations
@Override
getFlagsback to summary
public byte getFlags(int i)

Implements org.apache.fontbox.ttf.GlyphDescription.getFlags.

Doc from org.apache.fontbox.ttf.GlyphDescription.getFlags.

Returns the flags of the given point. To decode these bit flags, use the static elements of GlyfDescript. See also "Outline flags" in The 'glyf' table in the TrueType Reference Manual.

Parameters
i:int

the given point

Returns:byte

the flags value for the given point

Annotations
@Override
getPointCountback to summary
public int getPointCount()

Implements org.apache.fontbox.ttf.GlyphDescription.getPointCount.

Doc from org.apache.fontbox.ttf.GlyphDescription.getPointCount.

Returns the number of points.

Returns:int

the number of points

Annotations
@Override
getXCoordinateback to summary
public short getXCoordinate(int i)

Implements org.apache.fontbox.ttf.GlyphDescription.getXCoordinate.

Doc from org.apache.fontbox.ttf.GlyphDescription.getXCoordinate.

Returns the x coordinate of the given point.

Parameters
i:int

the given point

Returns:short

the x coordinate value for the given point

Annotations
@Override
getYCoordinateback to summary
public short getYCoordinate(int i)

Implements org.apache.fontbox.ttf.GlyphDescription.getYCoordinate.

Doc from org.apache.fontbox.ttf.GlyphDescription.getYCoordinate.

Returns the y coordinate of the given point.

Parameters
i:int

the given point

Returns:short

the y coordinate value for the given point

Annotations
@Override
isCompositeback to summary
public boolean isComposite()

Implements org.apache.fontbox.ttf.GlyphDescription.isComposite.

Doc from org.apache.fontbox.ttf.GlyphDescription.isComposite.

Returns whether this point is a composite or not.

Returns:boolean

true if this point is a composite

Annotations
@Override
readCoordsback to summary
private void readCoords(int count, TTFDataStream bais, short x0) throws IOException

The table is stored as relative values, but we'll store them as absolutes.

readFlagsback to summary
private void readFlags(int flagCount, TTFDataStream bais) throws IOException

The flags are run-length encoded.