GTGE API

com.golden.gamedev.object
Class GameFontManager

java.lang.Object
  extended by com.golden.gamedev.object.GameFontManager

public class GameFontManager
extends Object

Simplify GameFont creation and also behave as the storage of loaded font.

See Also:
com.golden.gamedev.object.font

Constructor Summary
GameFontManager()
          Creates new GameFontManager.
 
Method Summary
 void clear()
          Removed all loaded font from the storage.
 GameFont getFont(BufferedImage bitmap)
          Returns default AdvanceBitmapFont that using standard Bitmap Font Writer, created by Stefan Pettersson.
 GameFont getFont(BufferedImage[] bitmap)
          Returns bitmap font with specified images following this letter sequence : !
 GameFont getFont(BufferedImage[] bitmap, String letterSequence)
          Returns bitmap font with specified font images and letter sequence.
 GameFont getFont(BufferedImage bitmap, String letterSequence)
          Returns AdvanceBitmapFont that using standard Bitmap Font Writer, created by Stefan Pettersson.
 GameFont getFont(Font f)
          Returns font with specified system font, the color of the font is following active color of the graphics context where the font drawn.
 GameFont getFont(Font f, Color col)
          Returns font with specified system font and color.
 GameFont getFont(String name)
          Returns font with specified name.
 GameFont putFont(String name, GameFont font)
          Inserts font with specified name to font manager storage.
 Object removeFont(Object name)
          Removes font with specified name from font manager storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameFontManager

public GameFontManager()
Creates new GameFontManager.

Method Detail

clear

public void clear()
Removed all loaded font from the storage.


removeFont

public Object removeFont(Object name)
Removes font with specified name from font manager storage.

Returns:
Removed font.

getFont

public GameFont getFont(String name)
Returns font with specified name.

See Also:
putFont(String, GameFont)

putFont

public GameFont putFont(String name,
                        GameFont font)
Inserts font with specified name to font manager storage.

See Also:
getFont(String)

getFont

public GameFont getFont(BufferedImage bitmap)
Returns default AdvanceBitmapFont that using standard Bitmap Font Writer, created by Stefan Pettersson. Bitmap Font Writer is freeware font editor, visit Bitmap Font Writer website (http://www.stefan-pettersson.nu) for updates and additional information.

The images should be following this letter sequence :

         ! " # $ % & ' ( ) * + , - . / 0 1 2 3
       4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
       H I J K L M N O P Q R S T U V W X Y Z [
       \ ] ^ _ a b c d e f g h i j k l m n o p
       q r s t u v w x y z { | } ~
 
How to: Creating Bitmap Font Writer Font
The image size shall be cut exactly according to the font size, but leaving one pixel row above the characters.
This row of pixels is used to define each characters width.
The first pixel (0,0) will be used as the font width delimiters.

Parameters:
bitmap - the font images
Returns:
Bitmap GameFont.

getFont

public GameFont getFont(BufferedImage bitmap,
                        String letterSequence)
Returns AdvanceBitmapFont that using standard Bitmap Font Writer, created by Stefan Pettersson. Bitmap Font Writer is freeware font editor, visit Bitmap Font Writer website (http://www.stefan-pettersson.nu) for updates and additional information.

How to: Creating Bitmap Font Writer Font
The image size shall be cut exactly according to the font size, but leaving one pixel row above the characters.
This row of pixels is used to define each characters width.
The first pixel (0,0) will be used as the font width delimiters.

Parameters:
bitmap - the font images
letterSequence - the letter sequence of the bitmap
Returns:
Bitmap GameFont.

getFont

public GameFont getFont(BufferedImage[] bitmap)
Returns bitmap font with specified images following this letter sequence :
         ! " # $ % & ' ( ) * + , - . / 0 1 2 3
       4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
       H I J K L M N O P Q R S T U V W X Y Z [
       \ ] ^ _ a b c d e f g h i j k l m n o p
       q r s t u v w x y z { | } ~
 

If requested font has not been created before, this method creates new BitmapFont and return it.


getFont

public GameFont getFont(BufferedImage[] bitmap,
                        String letterSequence)
Returns bitmap font with specified font images and letter sequence.


getFont

public GameFont getFont(Font f)
Returns font with specified system font, the color of the font is following active color of the graphics context where the font drawn.


getFont

public GameFont getFont(Font f,
                        Color col)
Returns font with specified system font and color.


GTGE API

Copyright © 2003-2005 Golden T Studios. All rights reserved. Use is subject to license terms.
GoldenStudios.or.id