org.newdawn.slick.font
Class Glyph

java.lang.Object
  extended by org.newdawn.slick.font.Glyph

public class Glyph
extends java.lang.Object

Represents the glyph in a font for a unicode codepoint.

Author:
Nathan Sweet

Constructor Summary
Glyph(int codePoint, java.awt.Rectangle bounds, java.awt.font.GlyphVector vector, int index, UnicodeFont unicodeFont)
          Create a new glyph
 
Method Summary
 int getCodePoint()
          The unicode codepoint the glyph represents.
 int getHeight()
          The height of the glyph's image.
 Image getImage()
          The image to use for this glyph.
 java.awt.Shape getShape()
          The shape to use to draw this glyph.
 int getWidth()
          The width of the glyph's image.
 int getYOffset()
          The distance from drawing y location to top of this glyph, causing the glyph to sit on the baseline.
 boolean isMissing()
          Returns true if the font does not have a glyph for this codepoint.
 void setImage(Image image)
          Set the image that has been generated for this glyph
 void setShape(java.awt.Shape shape)
          Set the shape that should be drawn for this glyph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Glyph

public Glyph(int codePoint,
             java.awt.Rectangle bounds,
             java.awt.font.GlyphVector vector,
             int index,
             UnicodeFont unicodeFont)
Create a new glyph

Parameters:
codePoint - The code point in which this glyph can be found
bounds - The bounds that this glrph can fill
vector - The vector this glyph is part of
index - The index of this glyph within the vector
unicodeFont - The font this glyph forms part of
Method Detail

getCodePoint

public int getCodePoint()
The unicode codepoint the glyph represents.

Returns:
The codepoint the glyph represents

isMissing

public boolean isMissing()
Returns true if the font does not have a glyph for this codepoint.

Returns:
True if this glyph is not defined in the given code point

getWidth

public int getWidth()
The width of the glyph's image.

Returns:
The width in pixels of the glyphs image

getHeight

public int getHeight()
The height of the glyph's image.

Returns:
The height in pixels of the glyphs image

getShape

public java.awt.Shape getShape()
The shape to use to draw this glyph. This is set to null after the glyph is stored in a GlyphPage.

Returns:
The shape drawn for this glyph

setShape

public void setShape(java.awt.Shape shape)
Set the shape that should be drawn for this glyph

Parameters:
shape - The shape that should be drawn for this glyph

getImage

public Image getImage()
The image to use for this glyph. This is null until after the glyph is stored in a GlyphPage.

Returns:
The image that has been generated for this glyph

setImage

public void setImage(Image image)
Set the image that has been generated for this glyph

Parameters:
image - The image that has been generated for this glyph

getYOffset

public int getYOffset()
The distance from drawing y location to top of this glyph, causing the glyph to sit on the baseline.

Returns:
The offset on the y axis this glyph should be drawn at


Copyright © 2006 New Dawn Software. All Rights Reserved.