Class FontMapData

java.lang.Object
org.boxutil.units.standard.attribute.FontMapData

public class FontMapData extends Object
Only supported one page loading now. Do not use large texture font-map; The font height or width is 255 the maximum, and 0 is the minimum.
  • Field Details

    • _RESERVED_FONT

      protected static final FontMapData.BitMapGlyph _RESERVED_FONT
    • isBold

      protected final boolean isBold
    • isItalic

      protected final boolean isItalic
    • isUnicode

      protected final boolean isUnicode
    • isSmooth

      protected final boolean isSmooth
    • fontSize

      protected final byte fontSize
    • stretchH

      protected final byte stretchH
    • aaLevel

      protected final byte aaLevel
    • spacingX

      protected final byte spacingX
    • spacingY

      protected final byte spacingY
    • lineHeight

      protected final byte lineHeight
    • baseHeight

      protected final byte baseHeight
    • isValid

      protected boolean isValid
    • mapWidth

      protected final short mapWidth
    • mapHeight

      protected final short mapHeight
    • charCount

      protected final int charCount
    • fontMapID

      protected int fontMapID
    • name

      protected String name
    • fontMap

      protected com.fs.starfarer.api.graphics.SpriteAPI fontMap
    • glyphs

      protected final org.boxutil.backends.util.BUtil_GlyphSet<FontMapData.BitMapGlyph> glyphs
    • kerning

      protected final org.boxutil.backends.util.BUtil_GlyphKerningMap kerning
  • Constructor Details

    • FontMapData

      public FontMapData(String fontPath)
      Recommend to use FontDataManager.tryFont(String) to make it.
      Parameters:
      fontPath - should register the texture of font in settings.json, or set handel after by manual; otherwise system will try for loading the texture by TextureManager.
  • Method Details

    • checkValidWhenChangedFontMap

      protected void checkValidWhenChangedFontMap()
    • isValid

      public boolean isValid()
    • getName

      public String getName()
    • getTexture

      public com.fs.starfarer.api.graphics.SpriteAPI getTexture()
    • setTexture

      public void setTexture(com.fs.starfarer.api.graphics.SpriteAPI texture)
    • getTextureID

      public int getTextureID()
    • setTexture

      public void setTexture(int texture)
    • getFontSize

      public byte getFontSize()
    • isBold

      public boolean isBold()
    • isItalic

      public boolean isItalic()
    • isUnicode

      public boolean isUnicode()
    • getStretchH

      public byte getStretchH()
    • isSmooth

      public boolean isSmooth()
    • getAALevel

      public byte getAALevel()
    • getSpacingX

      public byte getSpacingX()
    • getSpacingY

      public byte getSpacingY()
    • getLineHeight

      public byte getLineHeight()
    • getLineBase

      public byte getLineBase()
      From chars bottom to baseline.
    • getMapWidth

      public short getMapWidth()
    • getMapHeight

      public short getMapHeight()
    • getGlyphNum

      public int getGlyphNum()
    • containsGlyph

      public boolean containsGlyph(char character)
    • getGlyph

      @Nullable public FontMapData.BitMapGlyph getGlyph(char character)
    • loadGlyph

      public boolean loadGlyph(char character, FontMapData.BitMapGlyph result)
    • haveKerning

      public boolean haveKerning()
    • getKerning

      public byte getKerning(char first, char second)