com.flagstone.transform.util.font
Class TrueTypeGlyph

java.lang.Object
  extended by com.flagstone.transform.util.font.Glyph
      extended by com.flagstone.transform.util.font.TrueTypeGlyph

public final class TrueTypeGlyph
extends Glyph

TrueTypeGlyph is a simple container class used to decode TrueType glyphs.


Constructor Summary
TrueTypeGlyph(Shape aShape)
          Create a TrueTypeGlyph with the specified outline - the bounding box and advance default to zero.
TrueTypeGlyph(Shape aShape, Bounds rect, int dist)
          Create a TrueTypeGlyph with the specified outline, bounding box and advance.
 
Method Summary
 void getCurve(boolean[] array)
          Get the set of flags which indicate which point are on the segment.
 void getEnd(int[] array)
          Get the set of end points for the segment of a glyph.
 void getXCoordinates(int[] array)
          Get the set of x coordinates representing a segment of a glyph.
 void getYCoordinates(int[] array)
          Get the set of y coordinates representing a segment of a glyph.
 int numberOfContours()
          Get the number of contours.
 int numberOfPoints()
          Get the number of points in the segment.
 void setCoordinates(int[] xcoords, int[] ycoords)
          Set the points for a segment of a glyph.
 void setEnds(int[] array)
          Set the end-points for a segment of a glyph.
 void setOnCurve(boolean[] array)
          Indicate which points are on the segment.
 
Methods inherited from class com.flagstone.transform.util.font.Glyph
getAdvance, getBounds, getShape, setAdvance, setBounds, setShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrueTypeGlyph

public TrueTypeGlyph(Shape aShape,
                     Bounds rect,
                     int dist)
Create a TrueTypeGlyph with the specified outline, bounding box and advance.

Parameters:
aShape - the outline of the glyph.
rect - the bounding box that encloses the glyph.
dist - the advance to the next glyph.

TrueTypeGlyph

public TrueTypeGlyph(Shape aShape)
Create a TrueTypeGlyph with the specified outline - the bounding box and advance default to zero.

Parameters:
aShape - the outline of the glyph.
Method Detail

getXCoordinates

public void getXCoordinates(int[] array)
Get the set of x coordinates representing a segment of a glyph.

Parameters:
array - an array where the points will be stored.

getYCoordinates

public void getYCoordinates(int[] array)
Get the set of y coordinates representing a segment of a glyph.

Parameters:
array - an array where the points will be stored.

getEnd

public void getEnd(int[] array)
Get the set of end points for the segment of a glyph.

Parameters:
array - an array where the points will be stored.

getCurve

public void getCurve(boolean[] array)
Get the set of flags which indicate which point are on the segment.

Parameters:
array - an array where the flags will be stored.

setCoordinates

public void setCoordinates(int[] xcoords,
                           int[] ycoords)
Set the points for a segment of a glyph.

Parameters:
xcoords - the set of x-coordinates for the points.
ycoords - the set of y-coordinates for the points.

setOnCurve

public void setOnCurve(boolean[] array)
Indicate which points are on the segment.

Parameters:
array - an array where the flags will be stored.

setEnds

public void setEnds(int[] array)
Set the end-points for a segment of a glyph.

Parameters:
array - the set of end points.

numberOfPoints

public int numberOfPoints()
Get the number of points in the segment.

Returns:
the number of points.

numberOfContours

public int numberOfContours()
Get the number of contours.

Returns:
the number of contours.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.