org.extex.font.format.xtf.tables
Class TtfTableGLYF.CompositeDescript

java.lang.Object
  extended by org.extex.font.format.xtf.tables.TtfTableGLYF.Descript
      extended by org.extex.font.format.xtf.tables.TtfTableGLYF.CompositeDescript
All Implemented Interfaces:
XMLWriterConvertible
Enclosing class:
TtfTableGLYF

public class TtfTableGLYF.CompositeDescript
extends TtfTableGLYF.Descript

Compound glyphs are glyphs made up of two or more component glyphs. A compound glyph description begins like a simple glyph description with four words describing the bounding box. It is followed by n component glyph parts. Each component glyph parts consists of a flag entry, two offset entries and from one to four transformation entries.

Type Name Description
uint16 flags Component flag
uint16 glyphIndex Glyph index of component
int16, uint16, int8 or uint8 argument1 X-offset for component or point number; type depends on bits 0 and 1 in component flags
int16, uint16, int8 or uint8 argument2 Y-offset for component or point number type depends on bits 0 and 1 in component flags
transformation option One of the transformation options from Table 19

Component flags

Flags Bit Description
ARG_1_AND_2_ARE_WORDS 0 If set, the arguments are words;
If not set, they are bytes.
ARGS_ARE_XY_VALUES 1 If set, the arguments are xy values;
If not set, they are points.
ROUND_XY_TO_GRID 2 If set, round the xy values to grid;
if not set do not round xy values to grid (relevant only to bit 1 is set)
WE_HAVE_A_SCALE 3 If set, there is a simple scale for the component.
If not set, scale is 1.0.
(this bit is obsolete) 4 (obsolete; set to zero)
MORE_COMPONENTS 5 If set, at least one additional glyph follows this one.
WE_HAVE_AN_X_AND_Y_SCALE 6 If set the x direction will use a different scale than the y direction.
WE_HAVE_A_TWO_BY_TWO 7 If set there is a 2-by-2 transformation that will be used to scale the component.
WE_HAVE_INSTRUCTIONS 8 If set, instructions for the component character follow the last component.
USE_MY_METRICS 9 Use metrics from this component for the compound glyph.
OVERLAP_COMPOUND 10 If set, the components of this compound glyph overlap.


Field Summary
 
Fields inherited from class org.extex.font.format.xtf.tables.TtfTableGLYF.Descript
ONCURVE, parentTable, REPEAT, XDUAL, XSHORTVECTOR, YDUAL, YSHORTVECTOR
 
Constructor Summary
TtfTableGLYF.CompositeDescript(TtfTableGLYF parentTable, java.io.ByteArrayInputStream bais)
          Create a new object.
 
Method Summary
 int getComponentCount()
          Returns the component count.
 int getComponentIndex(int i)
          Returns the component index.
protected  TtfTableGLYF.CompositeComp getCompositeComp(int i)
          Returns the composite comp.
protected  TtfTableGLYF.CompositeComp getCompositeCompEndPt(int i)
          Returns the composite end pt.
 int getContourCount()
          Returns the contour count.
 int getEndPtOfContours(int i)
          Returns the end pt of contours
 byte getFlags(int i)
          Returns the flags.
 int getPointCount()
          Returns the point count.
 short getXCoordinate(int i)
          Returns the x coordinate.
 short getYCoordinate(int i)
          Returns the y coordinate.
 boolean isComposite()
          Returns the composite.
 
Methods inherited from class org.extex.font.format.xtf.tables.TtfTableGLYF.Descript
getInstructions, getNumberOfContours, getXMax, getXMin, getYMax, getYMin, readInstructions, readInstructions, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TtfTableGLYF.CompositeDescript

public TtfTableGLYF.CompositeDescript(TtfTableGLYF parentTable,
                                      java.io.ByteArrayInputStream bais)
Create a new object.

Parameters:
parentTable - the parent table
bais - the bais
Method Detail

getComponentCount

public int getComponentCount()
Returns the component count.

Returns:
Returns the component count

getComponentIndex

public int getComponentIndex(int i)
Returns the component index.

Parameters:
i - the index
Returns:
Returns the component index.

getCompositeComp

protected TtfTableGLYF.CompositeComp getCompositeComp(int i)
Returns the composite comp.

Parameters:
i - the index
Returns:
Returns the composite comp.

getCompositeCompEndPt

protected TtfTableGLYF.CompositeComp getCompositeCompEndPt(int i)
Returns the composite end pt.

Parameters:
i - the index
Returns:
Returns the composite end

getContourCount

public int getContourCount()
Returns the contour count.

Returns:
Returns the contour count.
See Also:
TtfTableGLYF.Descript.getContourCount()

getEndPtOfContours

public int getEndPtOfContours(int i)
Returns the end pt of contours

Parameters:
i - the index
Returns:
Returns the end pt of contours
See Also:
TtfTableGLYF.Descript.getEndPtOfContours(int)

getFlags

public byte getFlags(int i)
Returns the flags.

Parameters:
i - the index
Returns:
Returns the flags.
See Also:
TtfTableGLYF.Descript.getFlags(int)

getPointCount

public int getPointCount()
Returns the point count.

Returns:
Returns the point count.
See Also:
TtfTableGLYF.Descript.getPointCount()

getXCoordinate

public short getXCoordinate(int i)
Returns the x coordinate.

Parameters:
i - the index
Returns:
Returns the x coordinate
See Also:
TtfTableGLYF.Descript.getXCoordinate(int)

getYCoordinate

public short getYCoordinate(int i)
Returns the y coordinate.

Parameters:
i - the index
Returns:
Returns the y coordinate
See Also:
TtfTableGLYF.Descript.getYCoordinate(int)

isComposite

public boolean isComposite()
Returns the composite.

Returns:
Returns the composite.
See Also:
TtfTableGLYF.Descript.isComposite()