Package org.apache.fontbox.ttf
Class GlyfCompositeComp
java.lang.Object
org.apache.fontbox.ttf.GlyfCompositeComp
This class is based on code from Apache Batik a subproject of Apache XMLGraphics. see
http://xmlgraphics.apache.org/batik/ for further details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final shortIf set, the arguments are words; otherwise, they are bytes.protected static final shortIf set, the arguments are xy values; otherwise they are points.private final shortprivate final shortprivate intprivate intprivate final shortprivate final intprotected static final shortIndicates at least one more glyph after this one.private intprivate intprotected static final shortIf set, xy values are rounded to those of the closest grid lines.private doubleprivate doubleprotected static final shortIf set, this forces the aw and lsb (and rsb) for the composite to be equal to those from this original glyph.protected static final shortIf set, there is a simple scale; otherwise, scale = 1.0.protected static final shortThere is a 2 by2 transformation that will be used to scale the component.protected static final shortThe x direction will use a different scale from the y direction.protected static final shortFollowing the last component are instructions for the composite character.private doubleprivate intprivate doubleprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshortReturns argument 1.shortReturns argument 2.intReturns the index of the first contour.intReturns the first index.shortgetFlags()Returns the flags of the glyph.intReturns the index of the first contour.doubleReturns the scale-01 value.doubleReturns the scale-10 value.doubleReturns the x-scaling value.intReturns the x-translation value.doubleReturns the y-scaling value.intReturns the y-translation value.intscaleX(int x, int y) Transforms an x-coordinate of a point for this component.intscaleY(int x, int y) Transforms a y-coordinate of a point for this component.voidsetFirstContour(int idx) Sets the index for the first contour.voidsetFirstIndex(int idx) Sets the first index.
-
Field Details
-
ARG_1_AND_2_ARE_WORDS
protected static final short ARG_1_AND_2_ARE_WORDSIf set, the arguments are words; otherwise, they are bytes.- See Also:
-
ARGS_ARE_XY_VALUES
protected static final short ARGS_ARE_XY_VALUESIf set, the arguments are xy values; otherwise they are points.- See Also:
-
ROUND_XY_TO_GRID
protected static final short ROUND_XY_TO_GRIDIf set, xy values are rounded to those of the closest grid lines.- See Also:
-
WE_HAVE_A_SCALE
protected static final short WE_HAVE_A_SCALEIf set, there is a simple scale; otherwise, scale = 1.0.- See Also:
-
MORE_COMPONENTS
protected static final short MORE_COMPONENTSIndicates at least one more glyph after this one.- See Also:
-
WE_HAVE_AN_X_AND_Y_SCALE
protected static final short WE_HAVE_AN_X_AND_Y_SCALEThe x direction will use a different scale from the y direction.- See Also:
-
WE_HAVE_A_TWO_BY_TWO
protected static final short WE_HAVE_A_TWO_BY_TWOThere is a 2 by2 transformation that will be used to scale the component.- See Also:
-
WE_HAVE_INSTRUCTIONS
protected static final short WE_HAVE_INSTRUCTIONSFollowing the last component are instructions for the composite character.- See Also:
-
USE_MY_METRICS
protected static final short USE_MY_METRICSIf set, this forces the aw and lsb (and rsb) for the composite to be equal to those from this original glyph.- See Also:
-
firstIndex
private int firstIndex -
firstContour
private int firstContour -
argument1
private final short argument1 -
argument2
private final short argument2 -
flags
private final short flags -
glyphIndex
private final int glyphIndex -
xscale
private double xscale -
yscale
private double yscale -
scale01
private double scale01 -
scale10
private double scale10 -
xtranslate
private int xtranslate -
ytranslate
private int ytranslate -
point1
private int point1 -
point2
private int point2
-
-
Constructor Details
-
GlyfCompositeComp
GlyfCompositeComp(TTFDataStream bais) throws IOException Constructor.- Parameters:
bais- the stream to be read- Throws:
IOException- is thrown if something went wrong
-
-
Method Details
-
setFirstIndex
public void setFirstIndex(int idx) Sets the first index.- Parameters:
idx- the first index
-
getFirstIndex
public int getFirstIndex()Returns the first index.- Returns:
- the first index.
-
setFirstContour
public void setFirstContour(int idx) Sets the index for the first contour.- Parameters:
idx- the index of the first contour
-
getFirstContour
public int getFirstContour()Returns the index of the first contour.- Returns:
- the index of the first contour.
-
getArgument1
public short getArgument1()Returns argument 1.- Returns:
- argument 1.
-
getArgument2
public short getArgument2()Returns argument 2.- Returns:
- argument 2.
-
getFlags
public short getFlags()Returns the flags of the glyph.- Returns:
- the flags.
-
getGlyphIndex
public int getGlyphIndex()Returns the index of the first contour.- Returns:
- index of the first contour.
-
getScale01
public double getScale01()Returns the scale-01 value.- Returns:
- the scale-01 value.
-
getScale10
public double getScale10()Returns the scale-10 value.- Returns:
- the scale-10 value.
-
getXScale
public double getXScale()Returns the x-scaling value.- Returns:
- the x-scaling value.
-
getYScale
public double getYScale()Returns the y-scaling value.- Returns:
- the y-scaling value.
-
getXTranslate
public int getXTranslate()Returns the x-translation value.- Returns:
- the x-translation value.
-
getYTranslate
public int getYTranslate()Returns the y-translation value.- Returns:
- the y-translation value.
-
scaleX
public int scaleX(int x, int y) Transforms an x-coordinate of a point for this component.- Parameters:
x- The x-coordinate of the point to transformy- The y-coordinate of the point to transform- Returns:
- The transformed x-coordinate
-
scaleY
public int scaleY(int x, int y) Transforms a y-coordinate of a point for this component.- Parameters:
x- The x-coordinate of the point to transformy- The y-coordinate of the point to transform- Returns:
- The transformed y-coordinate
-