Package com.sun.pdfview.font.ttf
Class GlyfSimple
- java.lang.Object
-
- com.sun.pdfview.font.ttf.Glyf
-
- com.sun.pdfview.font.ttf.GlyfSimple
-
public class GlyfSimple extends Glyf
A single simple glyph in a pdf font.
-
-
Field Summary
Fields Modifier and Type Field Description private short[]
contourEndPts
the end points of the various contoursprivate byte[]
flags
the flagsprivate byte[]
instructions
the instructionsprivate short[]
xCoords
the x coordinatesprivate short[]
yCoords
the y coordinates
-
Constructor Summary
Constructors Modifier Constructor Description protected
GlyfSimple()
Creates a new instance of a simple glyf
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getContourEndPoint(int index)
Get the end point of a given contourjava.nio.ByteBuffer
getData()
Get the data in this glyf as a byte buffer.byte
getFlag(int pointIndex)
Get a given flagbyte
getInstruction(int index)
Get a given instructionshort
getLength()
Get the length of this glyf.short
getNumInstructions()
Get the number of instructionsshort
getNumPoints()
Get the number of points in the glyfshort
getXCoord(int pointIndex)
Get a given x coordinateshort
getYCoord(int pointIndex)
Get a given y coordinateboolean
onCurve(int pointIndex)
Determine whether the given point is on the curveprotected boolean
repeat(int pointIndex)
Determine whether this flag repeatsprotected void
setContourEndPoints(short[] contourEndPts)
Set the number of contours in this glyfvoid
setData(java.nio.ByteBuffer data)
Set the data for this glyf.protected void
setFlags(byte[] flags)
Set the flagsprotected void
setInstructions(byte[] instructions)
Set the instructionsprotected void
setXCoords(short[] xCoords)
Set the x coordinatesprotected void
setYCoords(short[] yCoords)
Set the x coordinatesprotected boolean
xIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short.protected boolean
xIsSame(int pointIndex)
Determine whether the x value for the given point is the same as the previous value.protected boolean
yIsByte(int pointIndex)
Determine whether the x value for the given point is byte or short.protected boolean
yIsSame(int pointIndex)
Determine whether the y value for the given point is the same as the previous value.-
Methods inherited from class com.sun.pdfview.font.ttf.Glyf
getGlyf, getMaxX, getMaxY, getMinX, getMinY, getNumContours, isCompound, setCompound, setMaxX, setMaxY, setMinX, setMinY, setNumContours
-
-
-
-
Method Detail
-
setData
public void setData(java.nio.ByteBuffer data)
Set the data for this glyf.
-
getData
public java.nio.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.
-
getContourEndPoint
public short getContourEndPoint(int index)
Get the end point of a given contour
-
setContourEndPoints
protected void setContourEndPoints(short[] contourEndPts)
Set the number of contours in this glyf
-
getNumInstructions
public short getNumInstructions()
Get the number of instructions
-
getInstruction
public byte getInstruction(int index)
Get a given instruction
-
setInstructions
protected void setInstructions(byte[] instructions)
Set the instructions
-
getNumPoints
public short getNumPoints()
Get the number of points in the glyf
-
getFlag
public byte getFlag(int pointIndex)
Get a given flag
-
onCurve
public boolean onCurve(int pointIndex)
Determine whether the given point is on the curve
-
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
-
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
-
repeat
protected boolean repeat(int pointIndex)
Determine whether this flag repeats
-
xIsSame
protected boolean xIsSame(int pointIndex)
Determine whether the x value for the given point is the same as the previous value.
-
yIsSame
protected boolean yIsSame(int pointIndex)
Determine whether the y value for the given point is the same as the previous value.
-
setFlags
protected void setFlags(byte[] flags)
Set the flags
-
getXCoord
public short getXCoord(int pointIndex)
Get a given x coordinate
-
setXCoords
protected void setXCoords(short[] xCoords)
Set the x coordinates
-
getYCoord
public short getYCoord(int pointIndex)
Get a given y coordinate
-
setYCoords
protected void setYCoords(short[] yCoords)
Set the x coordinates
-
-