Class RenderFontJme

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

public class RenderFontJme extends Object implements de.lessvoid.nifty.spi.render.RenderFont
  • Constructor Details

    • RenderFontJme

      public RenderFontJme(String name, NiftyJmeDisplay display)
      Initialize the font.
      Parameters:
      name - font filename
      display - (not null)
  • Method Details

    • createText

      public BitmapText createText()
    • getFont

      public BitmapFont getFont()
    • 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(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(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