BitmapFont
Class BitmapFontsFamily

java.lang.Object
  |
  +--BitmapFont.BitmapFontsFamily

public class BitmapFontsFamily
extends java.lang.Object

Class used to generate, read, and render bitmap fonts. To generate fonts, run 1. cd .. 2. java BitmapFonts/BitmapFontsFamily fontfamilyname min max step this will generate fonts with size from min to max with increment step and the bitmap data are written into a file with name fontfamilyname.font To read fonts, call BitmapFontsFamily bff = new BitmapFontsFamily(fontfamilyname); bff.read(); Alarm: the file fontfamilyname.font must exist. To initialize GL, call setupGL(...), after which, call drawString(...) to draw the string on the GL context.

Author:
Li Zhang

Field Summary
 java.lang.String fname
           
 int[] indexByHeight
           
 int maxHeight
           
 int nofonts
           
 
Constructor Summary
BitmapFontsFamily(java.lang.String fn)
           
 
Method Summary
 int charWidth(java.lang.String s, int height, int i)
           
 void drawString(gl4java.GLFunc gl, java.lang.String s, int height)
           
 int fontPixelHeight(int height)
           
 void generate(int fmin, int fmax, int fstep)
           
 int getAscent(int height)
           
 int getDescent(int height)
           
static void main(java.lang.String[] args)
           
 void print(boolean verbose)
           
 void read()
           
 void setupGL(gl4java.GLFunc gl)
           
 int stringWidth(java.lang.String s, int height)
           
 void write()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fname

public java.lang.String fname

nofonts

public int nofonts

maxHeight

public int maxHeight

indexByHeight

public int[] indexByHeight
Constructor Detail

BitmapFontsFamily

public BitmapFontsFamily(java.lang.String fn)
Method Detail

read

public void read()
          throws java.io.IOException
java.io.IOException

write

public void write()
           throws java.io.IOException
java.io.IOException

generate

public void generate(int fmin,
                     int fmax,
                     int fstep)
              throws java.lang.Exception
java.lang.Exception

print

public void print(boolean verbose)

setupGL

public void setupGL(gl4java.GLFunc gl)

drawString

public void drawString(gl4java.GLFunc gl,
                       java.lang.String s,
                       int height)

stringWidth

public int stringWidth(java.lang.String s,
                       int height)

charWidth

public int charWidth(java.lang.String s,
                     int height,
                     int i)

getDescent

public int getDescent(int height)

fontPixelHeight

public int fontPixelHeight(int height)

getAscent

public int getAscent(int height)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception