Package com.jme3.font

Class BitmapFont

java.lang.Object
com.jme3.font.BitmapFont
All Implemented Interfaces:
Savable

public class BitmapFont extends Object implements Savable
Represents a font within jME that is generated with the AngelCode Bitmap Font Generator
  • Constructor Details

    • BitmapFont

      public BitmapFont()
  • Method Details

    • isRightToLeft

      public boolean isRightToLeft()
      Returns:
      true, if this is a right-to-left font, otherwise it will return false.
    • setRightToLeft

      public void setRightToLeft(boolean rightToLeft)
      Specify if this is a right-to-left font. By default it is set to false. This can be "overwritten" in the BitmapText constructor.
      Parameters:
      rightToLeft - true → right-to-left, false → left-to-right (default=false)
    • createLabel

      public BitmapText createLabel(String content)
    • getPreferredSize

      public float getPreferredSize()
    • setCharSet

      public void setCharSet(BitmapCharacterSet charSet)
    • setPages

      public void setPages(Material[] pages)
    • getPage

      public Material getPage(int index)
    • getPageSize

      public int getPageSize()
    • getCharSet

      public BitmapCharacterSet getCharSet()
    • setGlyphParser

      public void setGlyphParser(GlyphParser glyphParser)
      For cursive fonts a GlyphParser needs to be specified which is used to determine glyph shape by the adjacent glyphs. If nothing is set, all glyphs will be rendered isolated.
      Parameters:
      glyphParser - the desired parser (alias created) or null for none (default=null)
    • getGlyphParser

      public GlyphParser getGlyphParser()
      Returns:
      The GlyphParser set on the font, or null if it has no glyph parser.
    • getCharacterAdvance

      public float getCharacterAdvance(char curChar, char nextChar, float size)
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Throws:
      IOException
    • getLineWidth

      public float getLineWidth(CharSequence text)
    • merge

      public void merge(BitmapFont newFont)
      Merge two fonts. If two font have the same style, merge will fail.
      Parameters:
      newFont - Style must be assigned to this. author: Yonghoon
    • setStyle

      public void setStyle(int style)