de.lessvoid.nifty.spi.render
Interface RenderFont

All Known Implementing Classes:
TextRenderer.RenderFontNull

public interface RenderFont

RenderFont Interface.

Author:
void

Method Summary
 void dispose()
          This RenderFont is not needed anymore.
 int getCharacterAdvance(char currentCharacter, char nextCharacter, float size)
          Return the advance of the given character including kerning information.
 int getHeight()
          The height of the font in pixel.
 int getWidth(String text)
          Get width in pixel of given text.
 int getWidth(String text, float size)
          Get width in pixel of given text.
 

Method Detail

getWidth

int getWidth(String text)
Get width in pixel of given text.

Parameters:
text - the text to measure.
Returns:
the pixel width of the given text

getWidth

int getWidth(String text,
             float size)
Get width in pixel of given text.

Parameters:
text - the text to measure.
size - size
Returns:
the pixel width of the given text

getHeight

int getHeight()
The height of the font in pixel.

Returns:
font height in pixel.

getCharacterAdvance

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

Parameters:
currentCharacter - current character
nextCharacter - next character
size - font size
Returns:
width of the character or -1 when no information for the character is available

dispose

void dispose()
This RenderFont is not needed anymore. You should dispose any resources you allocated for this font.



Copyright © 2012. All Rights Reserved.