Class GlyfCompound
java.lang.Object
org.loboevolution.pdfview.font.ttf.Glyf
org.loboevolution.pdfview.font.ttf.GlyfCompound
A single simple glyph in a pdf font.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
argsAreWords
(int index) Determine whether args 1 and 2 are words or bytesboolean
argsAreXYValues
(int index) Determine whether args 1 and 2 are xy values or point indicesint
getComponentPoint
(int index) Get the point in the component glyph to matchint
getCompoundPoint
(int index) Get the point in the compound glyph to matchgetData()
Get the data in this glyf as a byte buffer.short
getFlag
(int index) Get a given flagint
getGlyphIndex
(int index) Get the glyf index for a given glyfbyte
getInstruction
(int index) Get a given instructionshort
Get the length of this glyf.int
Get the number of components in this compoundshort
Get the number of instructionsdouble[]
getTransform
(int index) Get the base affine transform.boolean
hasAScale
(int index) Determine whether there is a simple scaleprotected boolean
hasInstructions
(int index) Determine whether there are instructionsprotected boolean
hasTwoByTwo
(int index) Determine whether there is a 2x2 transformprotected boolean
hasXYScale
(int index) Determine whether there are separate scales on X and Yprotected boolean
moreComponents
(int index) Determine whether there are more components left to readboolean
overlapCompound
(int index) This component overlaps the existing compoundboolean
roundXYToGrid
(int index) Determine whether to round XY values to the gridvoid
setData
(ByteBuffer data) Set the data for this glyf.protected void
setInstructions
(byte[] instructions) Set the instructionsboolean
useMetrics
(int index) Use the metrics of this component for the compound
-
Constructor Details
-
GlyfCompound
protected GlyfCompound()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. Not implemented.
- Overrides:
getData
in classGlyf
- Returns:
- a
ByteBuffer
object.
-
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:
setData
in classGlyf
- Parameters:
data
- aByteBuffer
object.
-
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. Not implemented.
-
getNumComponents
public int getNumComponents()Get the number of components in this compound- Returns:
- a
Integer
object.
-
getFlag
public short getFlag(int index) Get a given flag- Parameters:
index
- aInteger
object.- Returns:
- a short.
-
getGlyphIndex
public int getGlyphIndex(int index) Get the glyf index for a given glyf -
getTransform
public double[] getTransform(int index) Get the base affine transform. This is based on a whacy formula defined in the true type font spec.- Parameters:
index
- aInteger
object.- Returns:
- an array of
invalid reference
double
-
getCompoundPoint
public int getCompoundPoint(int index) Get the point in the compound glyph to match -
getComponentPoint
public int getComponentPoint(int index) Get the point in the component glyph to match -
argsAreWords
public boolean argsAreWords(int index) Determine whether args 1 and 2 are words or bytes- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
argsAreXYValues
public boolean argsAreXYValues(int index) Determine whether args 1 and 2 are xy values or point indices- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
roundXYToGrid
public boolean roundXYToGrid(int index) Determine whether to round XY values to the grid- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
hasAScale
public boolean hasAScale(int index) Determine whether there is a simple scale- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
moreComponents
protected boolean moreComponents(int index) Determine whether there are more components left to read- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
hasXYScale
protected boolean hasXYScale(int index) Determine whether there are separate scales on X and Y- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
hasTwoByTwo
protected boolean hasTwoByTwo(int index) Determine whether there is a 2x2 transform- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
hasInstructions
protected boolean hasInstructions(int index) Determine whether there are instructions- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
useMetrics
public boolean useMetrics(int index) Use the metrics of this component for the compound- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
overlapCompound
public boolean overlapCompound(int index) This component overlaps the existing compound- Parameters:
index
- aInteger
object.- Returns:
- a boolean.
-
getNumInstructions
public short getNumInstructions()Get the number of instructions- Returns:
- a short.
-
getInstruction
public byte getInstruction(int index) Get a given instruction- Parameters:
index
- aInteger
object.- Returns:
- a byte.
-
setInstructions
protected void setInstructions(byte[] instructions) Set the instructions- Parameters:
instructions
- an array ofinvalid reference
byte
-