com.sun.pdfview.font.ttf

Class GlyfSimple

public class GlyfSimple extends Glyf

A single simple glyph in a pdf font.
Constructor Summary
protected GlyfSimple()
Creates a new instance of a simple glyf
Method Summary
shortgetContourEndPoint(int index)
Get the end point of a given contour
ByteBuffergetData()
Get the data in this glyf as a byte buffer.
bytegetFlag(int pointIndex)
Get a given flag
bytegetInstruction(int index)
Get a given instruction
shortgetLength()
Get the length of this glyf.
shortgetNumInstructions()
Get the number of instructions
shortgetNumPoints()
Get the number of points in the glyf
shortgetXCoord(int pointIndex)
Get a given x coordinate
shortgetYCoord(int pointIndex)
Get a given y coordinate
booleanonCurve(int pointIndex)
Determine whether the given point is on the curve
protected booleanrepeat(int pointIndex)
Determine whether this flag repeats
protected voidsetContourEndPoints(short[] contourEndPts)
Set the number of contours in this glyf
voidsetData(ByteBuffer data)
Set the data for this glyf.
protected voidsetFlags(byte[] flags)
Set the flags
protected voidsetInstructions(byte[] instructions)
Set the instructions
protected voidsetXCoords(short[] xCoords)
Set the x coordinates
protected voidsetYCoords(short[] yCoords)
Set the x coordinates
protected booleanxIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short.
protected booleanxIsSame(int pointIndex)
Determine whether the x value for the given point is the same as the previous value.
protected booleanyIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short.
protected booleanyIsSame(int pointIndex)
Determine whether the y value for the given point is the same as the previous value.

Constructor Detail

GlyfSimple

protected GlyfSimple()
Creates a new instance of a simple glyf

Method Detail

getContourEndPoint

public short getContourEndPoint(int index)
Get the end point of a given contour

getData

public ByteBuffer getData()
Get the data in this glyf as a byte buffer. Return the basic glyf data only, since there is no specific data. This method returns the data un-flipped, so subclasses can simply append to the allocated buffer.

getFlag

public byte getFlag(int pointIndex)
Get a given flag

getInstruction

public byte getInstruction(int index)
Get a given instruction

getLength

public short getLength()
Get the length of this glyf.

getNumInstructions

public short getNumInstructions()
Get the number of instructions

getNumPoints

public short getNumPoints()
Get the number of points in the glyf

getXCoord

public short getXCoord(int pointIndex)
Get a given x coordinate

getYCoord

public short getYCoord(int pointIndex)
Get a given y coordinate

onCurve

public boolean onCurve(int pointIndex)
Determine whether the given point is on the curve

repeat

protected boolean repeat(int pointIndex)
Determine whether this flag repeats

setContourEndPoints

protected void setContourEndPoints(short[] contourEndPts)
Set the number of contours in this glyf

setData

public void setData(ByteBuffer data)
Set the data for this glyf.

setFlags

protected void setFlags(byte[] flags)
Set the flags

setInstructions

protected void setInstructions(byte[] instructions)
Set the instructions

setXCoords

protected void setXCoords(short[] xCoords)
Set the x coordinates

setYCoords

protected void setYCoords(short[] yCoords)
Set the x coordinates

xIsByte

protected boolean xIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short. If true, it is a byte, if false it is a short

xIsSame

protected boolean xIsSame(int pointIndex)
Determine whether the x value for the given point is the same as the previous value.

yIsByte

protected boolean yIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short. If true, it is a byte, if false it is a short

yIsSame

protected boolean yIsSame(int pointIndex)
Determine whether the y value for the given point is the same as the previous value.