public class MalisisFont
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected CharData[] |
charData
Data for each character
|
protected boolean |
drawingShadow
Whether the currently drawn text is the shadow part
|
protected java.awt.Font |
font
AWT font used
|
protected FontGeneratorOptions |
fontGeneratorOptions
Options for the font
|
protected java.awt.font.FontRenderContext |
frc
Font render context
|
static MalisisFont |
minecraftFont |
protected int |
size
Size of the texture (width and height)
|
protected net.minecraft.util.ResourceLocation |
textureRl
ResourceLocation for the texture
|
| Constructor and Description |
|---|
MalisisFont(java.io.File fontFile) |
MalisisFont(java.io.File fontFile,
FontGeneratorOptions options) |
MalisisFont(java.awt.Font font) |
MalisisFont(java.awt.Font font,
FontGeneratorOptions options) |
MalisisFont(net.minecraft.util.ResourceLocation fontFile) |
MalisisFont(net.minecraft.util.ResourceLocation fontFile,
FontGeneratorOptions options) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clean(MalisisRenderer<?> renderer,
boolean isDrawing) |
protected void |
cleanLines(MalisisRenderer<?> renderer) |
protected void |
cleanShadow(MalisisRenderer<?> renderer) |
java.lang.String |
clipString(java.lang.String str,
int width,
FontOptions options)
Clips a string to fit in the specified width.
|
java.lang.String |
clipString(java.lang.String str,
int width,
FontOptions options,
boolean appendPeriods)
Clips a string to fit in the specified width.
|
protected void |
drawChar(CharData cd,
float offsetX,
float offsetY,
FontOptions options) |
protected void |
drawLineChar(CharData cd,
float offsetX,
float offsetY,
FontOptions options) |
protected void |
drawLines(java.lang.String text,
FontOptions options) |
protected void |
drawString(java.lang.String text,
FontOptions options) |
void |
generateTexture(boolean debug) |
CharData |
getCharData(char c) |
float |
getCharPosition(java.lang.String str,
FontOptions options,
int position,
int charOffset)
Determines the character for a given X coordinate.
|
float |
getCharWidth(char c)
Gets the rendering width of a char.
|
float |
getCharWidth(char c,
FontOptions options)
Gets the rendering width of a char with the specified fontScale.
|
float |
getMaxStringWidth(java.util.List<java.lang.String> strings)
Gets the max string width.
|
float |
getMaxStringWidth(java.util.List<java.lang.String> strings,
FontOptions options)
Gets max rendering width of an array of string.
|
net.minecraft.util.ResourceLocation |
getResourceLocation() |
Shape |
getShape(java.lang.String text,
float fontSize) |
float |
getStringHeight()
Gets the rendering height of strings.
|
float |
getStringHeight(FontOptions options)
Gets the rendering height of strings according to fontscale.
|
float |
getStringWidth(java.lang.String str,
FontOptions options) |
float |
getStringWidth(java.lang.String str,
FontOptions options,
int start,
int end)
Gets rendering width of a string according to fontScale.
|
static java.awt.Font |
load(java.io.File file,
FontGeneratorOptions options) |
static java.awt.Font |
load(java.io.InputStream is,
FontGeneratorOptions options) |
static java.awt.Font |
load(net.minecraft.util.ResourceLocation rl,
FontGeneratorOptions options) |
protected void |
loadCharacterData() |
protected void |
loadTexture(boolean forceGenerate) |
protected void |
prepare(MalisisRenderer<?> renderer,
float x,
float y,
float z,
FontOptions options) |
protected void |
prepareLines(MalisisRenderer<?> renderer,
FontOptions options) |
protected void |
prepareShadow(MalisisRenderer<?> renderer) |
java.lang.String |
processString(java.lang.String str,
FontOptions options)
Processes the passed string by translating it and replacing spacing characters and new lines.
|
protected java.awt.image.BufferedImage |
readTextureFile(java.io.File textureFile) |
protected void |
readUVFile(java.io.File uvFile) |
void |
render(MalisisRenderer<?> renderer,
java.lang.String text,
float x,
float y,
float z,
FontOptions options) |
protected int |
roundUp(int n) |
java.util.List<java.lang.String> |
wrapText(java.lang.String text,
int maxWidth)
Splits the string in multiple lines to fit in the specified maxWidth.
|
java.util.List<java.lang.String> |
wrapText(java.lang.String str,
int maxWidth,
FontOptions options)
Splits the string in multiple lines to fit in the specified maxWidth using the specified fontScale.
|
public static MalisisFont minecraftFont
protected java.awt.Font font
protected java.awt.font.FontRenderContext frc
protected FontGeneratorOptions fontGeneratorOptions
protected CharData[] charData
protected net.minecraft.util.ResourceLocation textureRl
protected int size
protected boolean drawingShadow
public MalisisFont(java.io.File fontFile)
public MalisisFont(java.io.File fontFile,
FontGeneratorOptions options)
public MalisisFont(net.minecraft.util.ResourceLocation fontFile)
public MalisisFont(net.minecraft.util.ResourceLocation fontFile,
FontGeneratorOptions options)
public MalisisFont(java.awt.Font font)
public MalisisFont(java.awt.Font font,
FontGeneratorOptions options)
public net.minecraft.util.ResourceLocation getResourceLocation()
public void generateTexture(boolean debug)
public CharData getCharData(char c)
public Shape getShape(java.lang.String text, float fontSize)
protected void prepare(MalisisRenderer<?> renderer, float x, float y, float z, FontOptions options)
protected void clean(MalisisRenderer<?> renderer, boolean isDrawing)
protected void prepareShadow(MalisisRenderer<?> renderer)
protected void cleanShadow(MalisisRenderer<?> renderer)
protected void prepareLines(MalisisRenderer<?> renderer, FontOptions options)
protected void cleanLines(MalisisRenderer<?> renderer)
public void render(MalisisRenderer<?> renderer, java.lang.String text, float x, float y, float z, FontOptions options)
protected void drawString(java.lang.String text,
FontOptions options)
protected void drawChar(CharData cd, float offsetX, float offsetY, FontOptions options)
protected void drawLines(java.lang.String text,
FontOptions options)
protected void drawLineChar(CharData cd, float offsetX, float offsetY, FontOptions options)
public java.lang.String processString(java.lang.String str,
FontOptions options)
str - the strpublic java.lang.String clipString(java.lang.String str,
int width,
FontOptions options)
str - the strwidth - the widthoptions - the optionspublic java.lang.String clipString(java.lang.String str,
int width,
FontOptions options,
boolean appendPeriods)
str - the strwidth - the widthoptions - the optionsappendPeriods - the append periodspublic float getStringWidth(java.lang.String str,
FontOptions options,
int start,
int end)
str - the stroptions - the optionsstart - the startend - the endpublic float getStringWidth(java.lang.String str,
FontOptions options)
public float getStringHeight()
public float getStringHeight(FontOptions options)
options - the optionspublic float getMaxStringWidth(java.util.List<java.lang.String> strings)
strings - the stringspublic float getMaxStringWidth(java.util.List<java.lang.String> strings,
FontOptions options)
strings - the stringsoptions - the optionspublic float getCharWidth(char c)
c - the cpublic float getCharWidth(char c,
FontOptions options)
c - the coptions - the optionspublic float getCharPosition(java.lang.String str,
FontOptions options,
int position,
int charOffset)
str - the stroptions - the optionsposition - the positioncharOffset - the char offsetpublic java.util.List<java.lang.String> wrapText(java.lang.String text,
int maxWidth)
text - the textmaxWidth - the max widthpublic java.util.List<java.lang.String> wrapText(java.lang.String str,
int maxWidth,
FontOptions options)
str - the strmaxWidth - the max widthoptions - the optionsprotected void loadCharacterData()
protected int roundUp(int n)
protected void loadTexture(boolean forceGenerate)
protected java.awt.image.BufferedImage readTextureFile(java.io.File textureFile)
protected void readUVFile(java.io.File uvFile)
public static java.awt.Font load(net.minecraft.util.ResourceLocation rl,
FontGeneratorOptions options)
public static java.awt.Font load(java.io.File file,
FontGeneratorOptions options)
public static java.awt.Font load(java.io.InputStream is,
FontGeneratorOptions options)