java.lang.Object
technology.sola.engine.assets.graphics.font.Font
- All Implemented Interfaces:
Asset
Font is an
Asset
containing the information required to render strings of text for a particular font that
has been rasterized into an image.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents the width and height that a string of text that would be rendered with a particularFont
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDimensionsForText
(String text) Calculates and returns theFont.TextDimensions
for a string of text that would be rendered with this font.boolean
hasGlyph
(char character) Checks to see if this Font has a glyph registered for rendering.
-
Constructor Details
-
Font
- Parameters:
fontImage
- the image for the rasterized fontfontInfo
- the information regarding the rasterized font
-
-
Method Details
-
getGlyph
- Parameters:
character
- the character to rendercolor
- the color to render the character- Returns:
- the image for the character's glyph in desired color
-
hasGlyph
public boolean hasGlyph(char character) Checks to see if this Font has a glyph registered for rendering.- Parameters:
character
- the character to check for a glyph- Returns:
- true if the Font has a glyph for the character
-
getDimensionsForText
Calculates and returns theFont.TextDimensions
for a string of text that would be rendered with this font.- Parameters:
text
- the string of text- Returns:
- the text dimensions
-
getFontInfo
- Returns:
- the
FontInfo
-