Package com.jme3.font
Class BitmapFont
java.lang.Object
com.jme3.font.BitmapFont
- All Implemented Interfaces:
Savable
Represents a font within jME that is generated with the AngelCode Bitmap Font Generator
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Specifies horizontal alignment for text.static enum
Specifies vertical alignment for text. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateLabel
(String content) float
getCharacterAdvance
(char curChar, char nextChar, float size) float
getLineWidth
(CharSequence text) getPage
(int index) int
float
boolean
void
merge
(BitmapFont newFont) Merge two fonts.void
read
(JmeImporter im) void
setCharSet
(BitmapCharacterSet charSet) void
setGlyphParser
(GlyphParser glyphParser) For cursive fonts a GlyphParser needs to be specified which is used to determine glyph shape by the adjacent glyphs.void
void
setRightToLeft
(boolean rightToLeft) Specify if this is a right-to-left font.void
setStyle
(int style) void
write
(JmeExporter ex)
-
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
-
getPreferredSize
public float getPreferredSize() -
setCharSet
-
setPages
-
getPage
-
getPageSize
public int getPageSize() -
getCharSet
-
setGlyphParser
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
- 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
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
getLineWidth
-
merge
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)
-