Class GlyfSimple
java.lang.Object
org.loboevolution.pdfview.font.ttf.Glyf
org.loboevolution.pdfview.font.ttf.GlyfSimple
A single simple glyph in a pdf font.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshortgetContourEndPoint(int index) Get the end point of a given contourgetData()Get the data in this glyf as a byte buffer.bytegetFlag(int pointIndex) Get a given flagbytegetInstruction(int index) Get a given instructionshortGet the length of this glyf.shortGet the number of instructionsshortGet the number of points in the glyfshortgetXCoord(int pointIndex) Get a given x coordinateshortgetYCoord(int pointIndex) Get a given y coordinatebooleanonCurve(int pointIndex) Determine whether the given point is on the curveprotected booleanrepeat(int pointIndex) Determine whether this flag repeatsprotected voidsetContourEndPoints(short[] contourEndPts) Set the number of contours in this glyfvoidsetData(ByteBuffer data) Set the data for this glyf.protected voidsetFlags(byte[] flags) Set the flagsprotected voidsetInstructions(byte[] instructions) Set the instructionsprotected voidsetXCoords(short[] xCoords) Set the x coordinatesprotected voidsetYCoords(short[] yCoords) Set the x coordinatesprotected 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 Details
-
GlyfSimple
protected GlyfSimple()Creates a new instance of a simple glyf
-
-
Method Details
-
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.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.
- Overrides:
getDatain classGlyf- Returns:
- a
ByteBufferobject.
-
setData
Set the data for this glyf. Do nothing, since a glyf with no contours has no glyf data.Set the data for this glyf.
- Overrides:
setDatain classGlyf- Parameters:
data- aByteBufferobject.
-
getLength
public short getLength()Get the length of this glyf. A glyf with no data has a length of 10 (2 bytes each for 5 short values)Get the length of this glyf.
-
getContourEndPoint
public short getContourEndPoint(int index) Get the end point of a given contour- Parameters:
index- aIntegerobject.- Returns:
- a short.
-
setContourEndPoints
protected void setContourEndPoints(short[] contourEndPts) Set the number of contours in this glyf- Parameters:
contourEndPts- an array ofobjects.invalid reference
short
-
getNumInstructions
public short getNumInstructions()Get the number of instructions- Returns:
- a short.
-
getInstruction
public byte getInstruction(int index) Get a given instruction- Parameters:
index- aIntegerobject.- Returns:
- a byte.
-
setInstructions
protected void setInstructions(byte[] instructions) Set the instructions- Parameters:
instructions- an array ofobjects.invalid reference
byte
-
getNumPoints
public short getNumPoints()Get the number of points in the glyf- Returns:
- a short.
-
getFlag
public byte getFlag(int pointIndex) Get a given flag- Parameters:
pointIndex- aIntegerobject.- Returns:
- a byte.
-
onCurve
public boolean onCurve(int pointIndex) Determine whether the given point is on the curve- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
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- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
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- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
repeat
protected boolean repeat(int pointIndex) Determine whether this flag repeats- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
xIsSame
protected boolean xIsSame(int pointIndex) Determine whether the x value for the given point is the same as the previous value.- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
yIsSame
protected boolean yIsSame(int pointIndex) Determine whether the y value for the given point is the same as the previous value.- Parameters:
pointIndex- aIntegerobject.- Returns:
- a boolean.
-
setFlags
protected void setFlags(byte[] flags) Set the flags- Parameters:
flags- an array ofobjects.invalid reference
byte
-
getXCoord
public short getXCoord(int pointIndex) Get a given x coordinate- Parameters:
pointIndex- aIntegerobject.- Returns:
- a short.
-
setXCoords
protected void setXCoords(short[] xCoords) Set the x coordinates- Parameters:
xCoords- an array ofobjects.invalid reference
short
-
getYCoord
public short getYCoord(int pointIndex) Get a given y coordinate- Parameters:
pointIndex- aIntegerobject.- Returns:
- a short.
-
setYCoords
protected void setYCoords(short[] yCoords) Set the x coordinates- Parameters:
yCoords- an array ofobjects.invalid reference
short
-