Interface GlyphProducer
-
public interface GlyphProducerUtility for creating glyphs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearGlyphs()Deletes all stored glyphs.GlyphcreateGlyph(char c)Makes a glyph for a single character.List<Glyph>createGlyphs(String str)Makes a glyph for each character in a string.floatfindAdvance(char c)Determines the distance to the next character after a glyph.Rectangle2DfindBounds(String str)Determines the visual bounds of a string with padding added.voidremoveGlyph(Glyph glyph)Deletes a single stored glyph.
-
-
-
Method Detail
-
clearGlyphs
void clearGlyphs()
Deletes all stored glyphs.
-
createGlyph
Glyph createGlyph(char c)
Makes a glyph for a single character.- Parameters:
c- Character- Returns:
- Reused instance of a glyph
-
createGlyphs
List<Glyph> createGlyphs(String str)
Makes a glyph for each character in a string.- Parameters:
str- Text as a string- Returns:
- View of glyphs valid until next call
- Throws:
NullPointerException- if string is null
-
findAdvance
float findAdvance(char c)
Determines the distance to the next character after a glyph.- Parameters:
c- Character to find advance of- Returns:
- Distance to the next character after a glyph, which may be negative
-
findBounds
Rectangle2D findBounds(String str)
Determines the visual bounds of a string with padding added.- Parameters:
str- Text to find visual bounds of- Returns:
- Visual bounds of string with padding added, not null
- Throws:
NullPointerException- if string is null
-
removeGlyph
void removeGlyph(Glyph glyph)
Deletes a single stored glyph.- Parameters:
glyph- Previously created glyph, ignored if null
-
-