com.hermetica.magician.fonts
Class GLTextureFont

java.lang.Object
  |
  +--com.hermetica.magician.fonts.GLTextureFont
Direct Known Subclasses:
GLCourier10TextureFont

public abstract class GLTextureFont
extends java.lang.Object

This class should be subclassed to provide class-based portable fonts that can be used in Magician.

Version:
$Revision: 1.5 $
Author:
Alligator Descartes for Arcane Technologies Ltd.

Field Summary
static java.lang.String VERSION
          Version information
 
Constructor Summary
GLTextureFont()
           
 
Method Summary
 void bindTexture()
          Binds the font texture
 void drawCharacter(byte charToDraw)
          Draws a character in the current font
 void drawCharacter(char charToDraw)
          Draws a character in the current font
 void drawCharacter(int charToDraw)
          Draws a character in the current font
 void drawString(byte[] stringToDraw)
          Draws the specified string in the current font
 void drawString(char[] stringToDraw)
          Draws the specified string in the current font
 void drawString(java.lang.String stringToDraw)
          Draws the specified string in the current font
 int getCharacterHeight(char character)
          Returns the height of the specified character
 int getCharacterWidth(char character)
          Returns the width of the specified character
 GLTextureChar getCharData(char character)
          Returns the data for the given character in the font
 int getFirstChar()
          Returns the first character index in the font
 GLTextureChar[] getFontData()
          Returns the font data for this font
 GLTextureCharInfo[] getFontInfo()
          Returns the font info for this font
 int getMaxAscent()
          Returns the max ascent of the font
 int getMaxDescent()
          Returns the max descent of the font
 java.lang.String getName()
          Returns the name of the font
 int getNumChars()
          Returns the number of characters in the font
 byte[] getTexture()
          Returns the texture for this font
 int getTextureHeight()
          Returns the texture height
 int getTextureWidth()
          Returns the texture width
 void initializeTexture(boolean useMipmaps)
          Initializes the texture objects after the font data is created
 void setFirstChar(int firstChar)
          Sets the first character in the font
 void setFontData(GLTextureChar[] fontData)
          Sets the font data at the given index
 void setFontInfo(GLTextureCharInfo[] info)
          Sets the font info for this font
 void setMaxAscent(int ascent)
          Sets the max ascent of the font
 void setMaxDescent(int descent)
          Sets the max descent of the font
 void setName(java.lang.String name)
          Sets the name of the font
 void setNumChars(int numChars)
          Sets the number of characters in the font
 void setTexture(byte[] texture)
          Sets the texture for this font
 void setTextureHeight(int height)
          Sets the texture height
 void setTextureWidth(int width)
          Sets the texture width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version information
Constructor Detail

GLTextureFont

public GLTextureFont()
Method Detail

getName

public final java.lang.String getName()
Returns the name of the font

setName

public final void setName(java.lang.String name)
Sets the name of the font

getFontData

public final GLTextureChar[] getFontData()
Returns the font data for this font

setFontData

public final void setFontData(GLTextureChar[] fontData)
Sets the font data at the given index

getNumChars

public final int getNumChars()
Returns the number of characters in the font

setNumChars

public final void setNumChars(int numChars)
Sets the number of characters in the font

getFirstChar

public final int getFirstChar()
Returns the first character index in the font

setFirstChar

public final void setFirstChar(int firstChar)
Sets the first character in the font

getCharacterWidth

public final int getCharacterWidth(char character)
Returns the width of the specified character

getCharacterHeight

public final int getCharacterHeight(char character)
Returns the height of the specified character

setFontInfo

public final void setFontInfo(GLTextureCharInfo[] info)
Sets the font info for this font

getFontInfo

public final GLTextureCharInfo[] getFontInfo()
Returns the font info for this font

setTexture

public final void setTexture(byte[] texture)
Sets the texture for this font

getTexture

public final byte[] getTexture()
Returns the texture for this font

setTextureWidth

public final void setTextureWidth(int width)
Sets the texture width

getTextureWidth

public final int getTextureWidth()
Returns the texture width

setTextureHeight

public final void setTextureHeight(int height)
Sets the texture height

getTextureHeight

public final int getTextureHeight()
Returns the texture height

setMaxAscent

public void setMaxAscent(int ascent)
Sets the max ascent of the font

getMaxAscent

public int getMaxAscent()
Returns the max ascent of the font

setMaxDescent

public void setMaxDescent(int descent)
Sets the max descent of the font

getMaxDescent

public int getMaxDescent()
Returns the max descent of the font

initializeTexture

public void initializeTexture(boolean useMipmaps)
Initializes the texture objects after the font data is created

bindTexture

public void bindTexture()
Binds the font texture

drawCharacter

public final void drawCharacter(byte charToDraw)
Draws a character in the current font

Parameters:
charToDraw - The character in the font to draw

drawCharacter

public final void drawCharacter(int charToDraw)
Draws a character in the current font

Parameters:
charToDraw - The character in the font to draw

drawCharacter

public void drawCharacter(char charToDraw)
Draws a character in the current font

Parameters:
charToDraw - The character in the font to draw

drawString

public final void drawString(java.lang.String stringToDraw)
Draws the specified string in the current font

Parameters:
stringToDraw - The string to draw

drawString

public final void drawString(char[] stringToDraw)
Draws the specified string in the current font

Parameters:
stringToDraw - The string to draw

drawString

public final void drawString(byte[] stringToDraw)
Draws the specified string in the current font

Parameters:
stringToDraw - The string to draw

getCharData

public final GLTextureChar getCharData(char character)
Returns the data for the given character in the font

Parameters:
character - The character to fetch the bitmap data for