Interface MapFont
public interface MapFont
A bitmap font to write on maps with.
Each character is a MapFont.Glyph: a small grid of set and unset pixels. Text is laid out on
lines lineHeight() pixels apart; on each line, glyph row 0 sits ascent()
pixels below the top of the line, which leaves room for the accents of capitals.
- Since:
- 0.1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCollects the glyphs of a font.static final recordThe pixels of one character. -
Method Summary
Modifier and TypeMethodDescriptionintascent()Returns how many pixels below the top of a line glyph row0is.fallback()Returns the glyph drawn for characters the font does not have.glyph(int codePoint) Returns the glyph of a character.intReturns how many empty columns separate two glyphs.intReturns how many pixels apart two lines are.intMeasures one line of text.
-
Method Details
-
glyph
Returns the glyph of a character.- Parameters:
codePoint- the character- Returns:
- its glyph, or
nullif the font does not have it - Since:
- 0.1.0
-
fallback
MapFont.Glyph fallback()Returns the glyph drawn for characters the font does not have.- Returns:
- the glyph drawn for characters the font does not have
- Since:
- 0.1.0
-
lineHeight
int lineHeight()Returns how many pixels apart two lines are.- Returns:
- how many pixels apart two lines are
- Since:
- 0.1.0
-
ascent
int ascent()Returns how many pixels below the top of a line glyph row0is.- Returns:
- how many pixels below the top of a line glyph row
0is - Since:
- 0.1.0
-
letterSpacing
int letterSpacing()Returns how many empty columns separate two glyphs.- Returns:
- how many empty columns separate two glyphs
- Since:
- 0.1.0
-
width
Measures one line of text.- Parameters:
text- the text, without line breaks- Returns:
- its width in pixels
- Since:
- 0.1.0
-