Interface MapFont.Builder

Enclosing interface:
MapFont

public static interface MapFont.Builder
Collects the glyphs of a font.
Since:
0.1.0
See Also:
  • Method Details

    • glyph

      MapFont.Builder glyph(int codePoint, MapFont.Glyph glyph)
      Adds or replaces a glyph.
      Parameters:
      codePoint - the character
      glyph - its pixels
      Returns:
      this builder
      Since:
      0.1.0
    • glyph

      MapFont.Builder glyph(int codePoint, int top, String... rows)
      Adds or replaces a glyph drawn as text, one string per row, # for drawn pixels.
      Parameters:
      codePoint - the character
      top - the line row of the first row, see MapFont.Glyph
      rows - the rows; the longest gives the width
      Returns:
      this builder
      Since:
      0.1.0
    • fallbackTo

      MapFont.Builder fallbackTo(MapFont font)
      Copies every glyph of another font that this builder does not have yet, for the characters 0-0xFFFF.
      Parameters:
      font - the font
      Returns:
      this builder
      Since:
      0.1.0
    • letterSpacing

      MapFont.Builder letterSpacing(int letterSpacing)
      Sets how many empty columns separate two glyphs, 1 by default.
      Parameters:
      letterSpacing - the spacing, at least 0
      Returns:
      this builder
      Since:
      0.1.0
    • fallback

      MapFont.Builder fallback(MapFont.Glyph fallback)
      Sets the glyph drawn for missing characters, a hollow box by default.
      Parameters:
      fallback - the glyph
      Returns:
      this builder
      Since:
      0.1.0
    • build

      MapFont build()
      Returns the font.
      Returns:
      the font
      Since:
      0.1.0