com.jme3.niftygui
Class RenderFontJme

java.lang.Object
  extended by com.jme3.niftygui.RenderFontJme
All Implemented Interfaces:
de.lessvoid.nifty.spi.render.RenderFont

public class RenderFontJme
extends java.lang.Object
implements de.lessvoid.nifty.spi.render.RenderFont


Constructor Summary
RenderFontJme(java.lang.String name, NiftyJmeDisplay display)
          Initialize the font.
 
Method Summary
 BitmapText createText()
           
 void dispose()
           
 int getCharacterAdvance(char currentCharacter, char nextCharacter, float size)
          Return the width of the given character including kerning information.
 int getHeight()
          get font height.
 BitmapText getText()
           
 int getWidth(java.lang.String str)
          get font width of the given string.
 int getWidth(java.lang.String str, float size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderFontJme

public RenderFontJme(java.lang.String name,
                     NiftyJmeDisplay display)
Initialize the font.

Parameters:
name - font filename
Method Detail

createText

public BitmapText createText()

getText

public BitmapText getText()

getHeight

public int getHeight()
get font height.

Specified by:
getHeight in interface de.lessvoid.nifty.spi.render.RenderFont
Returns:
height

getWidth

public int getWidth(java.lang.String str)
get font width of the given string.

Specified by:
getWidth in interface de.lessvoid.nifty.spi.render.RenderFont
Parameters:
str - text
Returns:
width of the given text for the current font

getWidth

public int getWidth(java.lang.String str,
                    float size)
Specified by:
getWidth in interface de.lessvoid.nifty.spi.render.RenderFont

getCharacterAdvance

public int getCharacterAdvance(char currentCharacter,
                               char nextCharacter,
                               float size)
Return the width of the given character including kerning information.

Specified by:
getCharacterAdvance in interface de.lessvoid.nifty.spi.render.RenderFont
Parameters:
currentCharacter - current character
nextCharacter - next character
size - font size
Returns:
width of the character or null when no information for the character is available

dispose

public void dispose()
Specified by:
dispose in interface de.lessvoid.nifty.spi.render.RenderFont