de.matthiasmann.twl.renderer.lwjgl
Class BitmapFont

java.lang.Object
  extended by de.matthiasmann.twl.renderer.lwjgl.BitmapFont

public class BitmapFont
extends java.lang.Object

A Bitmap Font class. Renders fonts generated by TWL Theme Editor's "Create font" tool.


Constructor Summary
BitmapFont(LWJGLRenderer renderer, java.io.Reader reader, java.net.URL baseUrl)
           
BitmapFont(LWJGLRenderer renderer, XMLParser xmlp, java.net.URL baseUrl)
           
 
Method Summary
protected  void beginLine()
           
 FontCache cacheMultiLineText(LWJGLFontCache cache, java.lang.CharSequence str, int width, HAlignment align)
           
 FontCache cacheText(LWJGLFontCache cache, java.lang.CharSequence str, int start, int end)
           
protected  void cleanup()
           
 void computeMultiLineInfo(java.lang.CharSequence str, int width, HAlignment align, int[] multiLineInfo)
           
 int computeMultiLineTextWidth(java.lang.CharSequence str)
           
 int computeTextWidth(java.lang.CharSequence str, int start, int end)
           
 int computeVisibleGlpyhs(java.lang.CharSequence str, int start, int end, int availWidth)
           
 void destroy()
           
 void drawLine(int x0, int y, int x1)
           
 void drawMultiLineLines(int x, int y, int[] multiLineInfo, int numLines)
           
protected  int drawMultiLineText(int x, int y, java.lang.CharSequence str, int width, HAlignment align)
           
protected  int drawText(int x, int y, java.lang.CharSequence str, int start, int end)
           
protected  void endLine()
           
 int getBaseLine()
           
 int getEM()
           
 int getEX()
           
 int getLineHeight()
           
 int getSpaceWidth()
           
 boolean isProportional()
           
static BitmapFont loadFont(LWJGLRenderer renderer, java.net.URL url)
           
protected  boolean prepare()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapFont

public BitmapFont(LWJGLRenderer renderer,
                  XMLParser xmlp,
                  java.net.URL baseUrl)
           throws org.xmlpull.v1.XmlPullParserException,
                  java.io.IOException
Throws:
org.xmlpull.v1.XmlPullParserException
java.io.IOException

BitmapFont

public BitmapFont(LWJGLRenderer renderer,
                  java.io.Reader reader,
                  java.net.URL baseUrl)
           throws java.io.IOException
Throws:
java.io.IOException
Method Detail

loadFont

public static BitmapFont loadFont(LWJGLRenderer renderer,
                                  java.net.URL url)
                           throws java.io.IOException
Throws:
java.io.IOException

isProportional

public boolean isProportional()

getBaseLine

public int getBaseLine()

getLineHeight

public int getLineHeight()

getSpaceWidth

public int getSpaceWidth()

getEM

public int getEM()

getEX

public int getEX()

destroy

public void destroy()

computeTextWidth

public int computeTextWidth(java.lang.CharSequence str,
                            int start,
                            int end)

computeVisibleGlpyhs

public int computeVisibleGlpyhs(java.lang.CharSequence str,
                                int start,
                                int end,
                                int availWidth)

drawText

protected int drawText(int x,
                       int y,
                       java.lang.CharSequence str,
                       int start,
                       int end)

drawMultiLineText

protected int drawMultiLineText(int x,
                                int y,
                                java.lang.CharSequence str,
                                int width,
                                HAlignment align)

computeMultiLineInfo

public void computeMultiLineInfo(java.lang.CharSequence str,
                                 int width,
                                 HAlignment align,
                                 int[] multiLineInfo)

beginLine

protected void beginLine()

endLine

protected void endLine()

drawMultiLineLines

public void drawMultiLineLines(int x,
                               int y,
                               int[] multiLineInfo,
                               int numLines)

drawLine

public void drawLine(int x0,
                     int y,
                     int x1)

computeMultiLineTextWidth

public int computeMultiLineTextWidth(java.lang.CharSequence str)

cacheMultiLineText

public FontCache cacheMultiLineText(LWJGLFontCache cache,
                                    java.lang.CharSequence str,
                                    int width,
                                    HAlignment align)

cacheText

public FontCache cacheText(LWJGLFontCache cache,
                           java.lang.CharSequence str,
                           int start,
                           int end)

prepare

protected boolean prepare()

cleanup

protected void cleanup()