com.flagstone.transform.util.font
Class Glyph

java.lang.Object
  extended by com.flagstone.transform.util.font.Glyph
Direct Known Subclasses:
TrueTypeGlyph

public class Glyph
extends Object

Glyph is a simple container class used by Font to record the shape, bounding box and advance for a glyph.


Constructor Summary
Glyph(Shape aShape)
          Create a Glyph with the specified outline - the bounding box and advance default to zero.
Glyph(Shape aShape, Bounds rect, int dist)
          Create a Glyph with the specified outline, bounding box and advance.
 
Method Summary
 int getAdvance()
          Get the distance to the next glyph.
 Bounds getBounds()
          Get the bounding box enclosing the glyph.
 Shape getShape()
          Get the outline of the glyph.
 void setAdvance(int dist)
          Set the distance to the next glyph.
 void setBounds(Bounds rect)
          Set the bounding box enclosing the glyph.
 void setShape(Shape aShape)
          Set the outline of the glyph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Glyph

public Glyph(Shape aShape,
             Bounds rect,
             int dist)
Create a Glyph 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.

Glyph

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

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

getShape

public final Shape getShape()
Get the outline of the glyph.

Returns:
the Shape used to trace the outline of the glyph.

setShape

public final void setShape(Shape aShape)
Set the outline of the glyph.

Parameters:
aShape - the Shape used to trace the outline of the glyph.

getBounds

public final Bounds getBounds()
Get the bounding box enclosing the glyph.

Returns:
the Bounds that encloses the outline of the glyph.

setBounds

public final void setBounds(Bounds rect)
Set the bounding box enclosing the glyph.

Parameters:
rect - the Bounds that encloses the outline of the glyph.

getAdvance

public final int getAdvance()
Get the distance to the next glyph.

Returns:
the distance in twips from this glyph to the next.

setAdvance

public final void setAdvance(int dist)
Set the distance to the next glyph.

Parameters:
dist - the distance in twips from this glyph to the next.


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