Class FontMapData
java.lang.Object
org.boxutil.units.standard.attribute.FontMapData
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final FontMapData.BitMapGlyphprotected final byteprotected final byteprotected final intprotected com.fs.starfarer.api.graphics.SpriteAPIprotected intprotected final byteprotected final org.boxutil.backends.util.BUtil_GlyphSet<FontMapData.BitMapGlyph>protected final booleanprotected final booleanprotected final booleanprotected final booleanprotected booleanprotected final org.boxutil.backends.util.BUtil_GlyphKerningMapprotected final byteprotected final shortprotected final shortprotected Stringprotected final byteprotected final byteprotected final byte -
Constructor Summary
ConstructorsConstructorDescriptionFontMapData(String fontPath) Recommend to useFontDataManager.tryFont(String)to make it. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleancontainsGlyph(char character) bytebytegetGlyph(char character) intbytegetKerning(char first, char second) byteFrom chars bottom to baseline.byteshortshortgetName()bytebytebytecom.fs.starfarer.api.graphics.SpriteAPIintbooleanbooleanisBold()booleanisItalic()booleanisSmooth()booleanbooleanisValid()booleanloadGlyph(char character, FontMapData.BitMapGlyph result) voidsetTexture(int texture) voidsetTexture(com.fs.starfarer.api.graphics.SpriteAPI texture)
-
Field Details
-
_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
-
fontMap
protected com.fs.starfarer.api.graphics.SpriteAPI fontMap -
glyphs
-
kerning
protected final org.boxutil.backends.util.BUtil_GlyphKerningMap kerning
-
-
Constructor Details
-
FontMapData
Recommend to useFontDataManager.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 byTextureManager.
-
-
Method Details
-
checkValidWhenChangedFontMap
protected void checkValidWhenChangedFontMap() -
isValid
public boolean isValid() -
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
-
loadGlyph
-
haveKerning
public boolean haveKerning() -
getKerning
public byte getKerning(char first, char second)
-