Interface DMFontConfig
public interface DMFontConfig
Represents a font configuration. This is used to configure the appearance of the
font like the family, size, line spacing, ...
-
Method Summary
Modifier and TypeMethodDescriptionGets the alignment of the font.Gets the family of the font.float
Gets the line spacing of the font.int
Gets the max lines of the font.int
Gets the max line width of the font.@NotNull String
getName()
Gets the name of this font configuration.int
Gets the oversample of the font.int
getSize()
Gets the size of the font.float
Gets the vertical shift of the font.void
setAlignment
(TextAlignment alignment) Sets the alignment of the font.void
Sets the family of the font.void
setLineSpacing
(float lineSpacing) Sets the line spacing of the font.void
setMaxLines
(int maxLines) Sets the max lines of the font.int
setMaxLineWidth
(int maxWidth) Sets the max line width of the font.void
Sets the name of the font configuration.void
setOversample
(int oversample) Sets the oversample of the font.void
setSize
(int size) Sets the size of the font.void
setVerticalShift
(float verticalShift) Sets the vertical shift of the font.This is the vertical shift of the first line.
-
Method Details
-
getName
Gets the name of this font configuration.- Returns:
- The name of the font configuration.
-
setName
Sets the name of the font configuration.- Parameters:
name
- The name of the font configuration.
-
getFamily
String getFamily()Gets the family of the font. If the font is not found, it will use the default font.- Returns:
- The family of the font.
-
setFamily
Sets the family of the font. The default Minecraft font is called "default", but you can also import other fonts by putting them inside the "import/fonts" folder inside the DialogueMaster plugin folder.- Parameters:
family
- The family of the font.
-
getSize
int getSize()Gets the size of the font. Defaults to 12.- Returns:
- The size of the font.
-
setSize
void setSize(int size) Sets the size of the font. 12 is recommended for most fonts.- Parameters:
size
- The size of the font.
-
getOversample
int getOversample()Gets the oversample of the font. This is the quality at which it renders the font. Defaults to 16.- Returns:
- The oversample of the font.
-
setOversample
void setOversample(int oversample) Sets the oversample of the font. This is the quality at which it renders the font. 16 is recommended for most fonts.- Parameters:
oversample
- The oversample of the font.
-
getVerticalShift
float getVerticalShift()Gets the vertical shift of the font. This is the vertical shift of the first line. The other lines will be determined by this value plus x times the line spacing.- Returns:
- The vertical shift of the font.
-
setVerticalShift
void setVerticalShift(float verticalShift) Sets the vertical shift of the font.This is the vertical shift of the first line. The other lines will be determined by this value plus x times the line spacing.- Parameters:
verticalShift
- The vertical shift of the font.
-
getLineSpacing
float getLineSpacing()Gets the line spacing of the font.- Returns:
- The line spacing of the font.
-
setLineSpacing
void setLineSpacing(float lineSpacing) Sets the line spacing of the font.- Parameters:
lineSpacing
- The line spacing of the font.
-
getMaxLines
int getMaxLines()Gets the max lines of the font.- Returns:
- The max lines of the font.
-
setMaxLines
void setMaxLines(int maxLines) Sets the max lines of the font. Defaults to 5.- Parameters:
maxLines
- The max lines of the font.
-
getAlignment
TextAlignment getAlignment()Gets the alignment of the font.- Returns:
- The alignment of the font.
-
setAlignment
Sets the alignment of the font.- Parameters:
alignment
- The alignment of the font.
-
getMaxLineWidth
int getMaxLineWidth()Gets the max line width of the font.- Returns:
- The max line width of the font.
-
setMaxLineWidth
int setMaxLineWidth(int maxWidth) Sets the max line width of the font.- Parameters:
maxWidth
- The max line width of the font.- Returns:
- The max line width of the font.
-