Package com.sun.pdfview.font.ttf
Class GlyfCompound
- java.lang.Object
-
- com.sun.pdfview.font.ttf.Glyf
-
- com.sun.pdfview.font.ttf.GlyfCompound
-
public class GlyfCompound extends Glyf
A single simple glyph in a pdf font.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classGlyfCompound.GlyfComponentThe record for a single component of this compound glyph
-
Field Summary
Fields Modifier and Type Field Description private static intARG_1_AND_2_ARE_WORDSflagsprivate static intARGS_ARE_XY_VALUESprivate GlyfCompound.GlyfComponent[]componentsthe flags for each compound glyphprivate byte[]instructionsthe instructions for the compound as a wholeprivate static intMORE_COMPONENTSprivate static intOVERLAP_COMPOUNDprivate static intROUND_XY_TO_GRIDprivate static intUSE_MY_METRICSprivate static intWE_HAVE_A_SCALEprivate static intWE_HAVE_A_TWO_BY_TWOprivate static intWE_HAVE_AN_X_AND_Y_SCALEprivate static intWE_HAVE_INSTRUCTIONS
-
Constructor Summary
Constructors Modifier Constructor Description protectedGlyfCompound()Creates a new instance of a simple glyf
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanargsAreWords(int index)Determine whether args 1 and 2 are words or bytesbooleanargsAreXYValues(int index)Determine whether args 1 and 2 are xy values or point indicesintgetComponentPoint(int index)Get the point in the component glyph to matchintgetCompoundPoint(int index)Get the point in the compound glyph to matchjava.nio.ByteBuffergetData()Get the data in this glyf as a byte buffer.shortgetFlag(int index)Get a given flagshortgetGlyphIndex(int index)Get the glyf index for a given glyfbytegetInstruction(int index)Get a given instructionshortgetLength()Get the length of this glyf.intgetNumComponents()Get the number of components in this compoundshortgetNumInstructions()Get the number of instructionsdouble[]getTransform(int index)Get the base affine transform.booleanhasAScale(int index)Determine whether there is a simple scaleprotected booleanhasInstructions(int index)Determine whether there are instructionsprotected booleanhasTwoByTwo(int index)Determine whether there is a 2x2 transformprotected booleanhasXYScale(int index)Determine whether there are separate scales on X and Yprotected booleanmoreComponents(int index)Determine whether there are more components left to readbooleanoverlapCompound(int index)This component overlaps the existing compoundbooleanroundXYToGrid(int index)Determine whether to round XY values to the grid(package private) voidsetComponents(GlyfCompound.GlyfComponent[] components)Set the componentsvoidsetData(java.nio.ByteBuffer data)Set the data for this glyf.protected voidsetInstructions(byte[] instructions)Set the instructionsbooleanuseMetrics(int index)Use the metrics of this component for the compound-
Methods inherited from class com.sun.pdfview.font.ttf.Glyf
getGlyf, getMaxX, getMaxY, getMinX, getMinY, getNumContours, isCompound, setCompound, setMaxX, setMaxY, setMinX, setMinY, setNumContours
-
-
-
-
Field Detail
-
ARG_1_AND_2_ARE_WORDS
private static final int ARG_1_AND_2_ARE_WORDS
flags- See Also:
- Constant Field Values
-
ARGS_ARE_XY_VALUES
private static final int ARGS_ARE_XY_VALUES
- See Also:
- Constant Field Values
-
ROUND_XY_TO_GRID
private static final int ROUND_XY_TO_GRID
- See Also:
- Constant Field Values
-
WE_HAVE_A_SCALE
private static final int WE_HAVE_A_SCALE
- See Also:
- Constant Field Values
-
MORE_COMPONENTS
private static final int MORE_COMPONENTS
- See Also:
- Constant Field Values
-
WE_HAVE_AN_X_AND_Y_SCALE
private static final int WE_HAVE_AN_X_AND_Y_SCALE
- See Also:
- Constant Field Values
-
WE_HAVE_A_TWO_BY_TWO
private static final int WE_HAVE_A_TWO_BY_TWO
- See Also:
- Constant Field Values
-
WE_HAVE_INSTRUCTIONS
private static final int WE_HAVE_INSTRUCTIONS
- See Also:
- Constant Field Values
-
USE_MY_METRICS
private static final int USE_MY_METRICS
- See Also:
- Constant Field Values
-
OVERLAP_COMPOUND
private static final int OVERLAP_COMPOUND
- See Also:
- Constant Field Values
-
components
private GlyfCompound.GlyfComponent[] components
the flags for each compound glyph
-
instructions
private byte[] instructions
the instructions for the compound as a whole
-
-
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. Not implemented.
-
getLength
public short getLength()
Get the length of this glyf. Not implemented.
-
getNumComponents
public int getNumComponents()
Get the number of components in this compound
-
getFlag
public short getFlag(int index)
Get a given flag
-
getGlyphIndex
public short 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.
-
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
-
argsAreXYValues
public boolean argsAreXYValues(int index)
Determine whether args 1 and 2 are xy values or point indices
-
roundXYToGrid
public boolean roundXYToGrid(int index)
Determine whether to round XY values to the grid
-
hasAScale
public boolean hasAScale(int index)
Determine whether there is a simple scale
-
moreComponents
protected boolean moreComponents(int index)
Determine whether there are more components left to read
-
hasXYScale
protected boolean hasXYScale(int index)
Determine whether there are separate scales on X and Y
-
hasTwoByTwo
protected boolean hasTwoByTwo(int index)
Determine whether there is a 2x2 transform
-
hasInstructions
protected boolean hasInstructions(int index)
Determine whether there are instructions
-
useMetrics
public boolean useMetrics(int index)
Use the metrics of this component for the compound
-
overlapCompound
public boolean overlapCompound(int index)
This component overlaps the existing compound
-
setComponents
void setComponents(GlyfCompound.GlyfComponent[] components)
Set the components
-
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
-
-