Glyphs can be created easily using specified character defined in the
font. For example, \uf013 in FontAwesome is used to represent
a gear icon.
To simplify glyph customization, methods can be chained, for example:
Glyph glyph = fontAwesome.create('\uf013').size(28).color(Color.RED); //GEAR
Here's a screenshot of two font packs being used to render images into
JavaFX Button controls:

| Modifier and Type | Field and Description |
|---|---|
| private final double | |
| private boolean | |
| private final Runnable | |
| private final String | |
| private final Map | namedGlyphs
* Private fields * * |
| Access | Constructor and Description |
|---|---|
| public | GlyphFont(String
glyph font name fontName, int default font size defaultSize, final InputStream input stream to load the font from in)Loads glyph font from specified |
| public | |
| public | GlyphFont(String
glyph font name fontName, int default font size defaultSize, final InputStream input stream to load the font from in, boolean If true, the font will only be loaded when accessed lazyLoad)Loads glyph font from specified |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Glyph | |
| public Glyph | |
| public Glyph | |
| pack-priv synchronized void | |
| public Character | |
| public double | |
| public String | |
| public void | |
| public void | registerAll(Iterable<? extends INamedCharacter> namedCharacters)
Registers all given characters with their name. |
| defaultSize | back to summary |
|---|---|
| private final double defaultSize | |
| fontLoaded | back to summary |
|---|---|
| private boolean fontLoaded | |
| fontLoader | back to summary |
|---|---|
| private final Runnable fontLoader | |
| fontName | back to summary |
|---|---|
| private final String fontName | |
| namedGlyphs | back to summary |
|---|---|
| private final Map<String, Character> namedGlyphs * Private fields * * | |
| GlyphFont | back to summary |
|---|---|
| public GlyphFont(String fontName, int defaultSize, final InputStream in) Loads glyph font from specified
| |
| GlyphFont | back to summary |
|---|---|
| public GlyphFont(String fontName, int defaultSize, final String urlStr) Load glyph font from specified URL. Example for a local file: "file:///C:/Users/Bob/Fonts/icomoon.ttf" "file:///Users/Bob/Fonts/icomoon.ttf" | |
| GlyphFont | back to summary |
|---|---|
| public GlyphFont(String fontName, int defaultSize, final InputStream in, boolean lazyLoad) Loads glyph font from specified
| |
| GlyphFont | back to summary |
|---|---|
| public GlyphFont(String fontName, int defaultSize, final String urlStr, boolean lazyLoad) Load glyph font from specified URL. Example for a local file: "file:///C:/Users/Bob/Fonts/icomoon.ttf" "file:///Users/Bob/Fonts/icomoon.ttf" | |
| GlyphFont | back to summary |
|---|---|
| private GlyphFont(String fontName, int defaultSize, Runnable fontLoader, boolean lazyLoad) Creates a GlyphFont | |
| create | back to summary |
|---|---|
| public Glyph create(char character) Creates an instance of | |
| create | back to summary |
|---|---|
| public Glyph create(String glyphName) Creates an instance of | |
| create | back to summary |
|---|---|
| public Glyph create(Enum<?> glyph) Creates an instance of | |
| ensureFontIsLoaded | back to summary |
|---|---|
| pack-priv synchronized void ensureFontIsLoaded() Ensures that the font is loaded | |
| getCharacter | back to summary |
|---|---|
| public Character getCharacter(String glyphName) Returns the character code which is mapped to this Name. If no match is found, NULL is returned. | |
| getDefaultSize | back to summary |
|---|---|
| public double getDefaultSize() Returns the default font size
| |
| getName | back to summary |
|---|---|
| public String getName() Returns font name
| |
| register | back to summary |
|---|---|
| public void register(String name, Character character) Registers the given name-character mapping | |
| registerAll | back to summary |
|---|---|
| public void registerAll(Iterable<? extends INamedCharacter> namedCharacters) Registers all given characters with their name. | |