Package arc.freetype
Class FreeTypeFontGenerator.FreeTypeFontData
java.lang.Object
arc.graphics.g2d.Font.FontData
arc.freetype.FreeTypeFontGenerator.FreeTypeFontData
- All Implemented Interfaces:
Disposable
- Enclosing class:
- FreeTypeFontGenerator
public static class FreeTypeFontGenerator.FreeTypeFontData
extends Font.FontData
implements Disposable
Font.FontData
used for fonts generated via the FreeTypeFontGenerator
. The texture storing the glyphs is
held in memory, thus the Font.FontData.getImagePaths()
and Font.FontData.getFontFile()
methods will return null.-
Field Summary
Fields inherited from class arc.graphics.g2d.Font.FontData
ascent, blankLineScale, breakChars, capChars, capHeight, cursorX, descent, down, flipped, fontFile, imagePaths, lineHeight, markupEnabled, missingGlyph, padBottom, padLeft, padRight, padTop, scaleX, scaleY, spaceXadvance, xChars, xHeight
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Releases all resources of this object.getGlyph
(char ch) Returns the glyph for the specified character, or null if no such glyph exists.void
getGlyphs
(GlyphLayout.GlyphRun run, CharSequence str, int start, int end, Font.Glyph lastGlyph) Using the specified string, populates the glyphs and positions of the specified glyph run.Methods inherited from class arc.graphics.g2d.Font.FontData
getFirstGlyph, getFontFile, getImagePath, getImagePaths, getWrapIndex, hasGlyph, isBreakChar, isWhitespace, load, scale, setGlyph, setGlyphRegion, setLineHeight, setScale, setScale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
-
Constructor Details
-
FreeTypeFontData
public FreeTypeFontData()
-
-
Method Details
-
getGlyph
Description copied from class:Font.FontData
Returns the glyph for the specified character, or null if no such glyph exists. Note thatFont.FontData.getGlyphs(GlyphRun, CharSequence, int, int, Glyph)
should be be used to shape a string of characters into a list of glyphs.- Overrides:
getGlyph
in classFont.FontData
-
getGlyphs
public void getGlyphs(GlyphLayout.GlyphRun run, CharSequence str, int start, int end, Font.Glyph lastGlyph) Description copied from class:Font.FontData
Using the specified string, populates the glyphs and positions of the specified glyph run.- Overrides:
getGlyphs
in classFont.FontData
str
- Characters to convert to glyphs. Will not contain newline or color tags. May contain "[[" for an escaped left square bracket.lastGlyph
- The glyph immediately before this run, or null if this is run is the first on a line of text.
-
dispose
public void dispose()Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-