public class GuiFontResolver
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GuiFontResolver.FontCache
Font cache item.
|
Modifier and Type | Field and Description |
---|---|
private BaseConfig |
config
Widget config.
|
private boolean |
fixedFont
Flag identifying that the referenced font must default to the default fixed font, if is
not specified.
|
private java.util.Map<java.lang.Integer,GuiFontResolver.FontCache> |
fontCache
Widget font cache.
|
boolean |
fontChanged
true when there is a newly added font. |
private GuiDriver |
gd
Screen driver.
|
private Window<?> |
window
Window instance.
|
Constructor and Description |
---|
GuiFontResolver(Window<?> window,
GuiDriver gd,
BaseConfig config)
Constructor.
|
GuiFontResolver(Window<?> window,
GuiDriver gd,
BaseConfig config,
boolean fixedFont)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
GuiFontResolver.FontCache |
font()
Resolve font.
|
int |
resolveFontNum()
Resolve the font number, in case the configuration has an undefined font.
|
public boolean fontChanged
true
when there is a newly added font.private java.util.Map<java.lang.Integer,GuiFontResolver.FontCache> fontCache
private Window<?> window
private GuiDriver gd
private BaseConfig config
private boolean fixedFont
public GuiFontResolver(Window<?> window, GuiDriver gd, BaseConfig config)
If the referenced BaseConfig.font
is undefined, it defaults to the
FontManager.DEFAULT_FONT
.
window
- Window instance.gd
- Screen driver.config
- Widget configuration.public GuiFontResolver(Window<?> window, GuiDriver gd, BaseConfig config, boolean fixedFont)
window
- Window instance.gd
- Screen driver.config
- Widget configuration.fixedFont
- Flag identifying that the referenced font must default to the default fixed font,
if is not specified.public GuiFontResolver.FontCache font()
public int resolveFontNum()
configured
font is undefined, then either the
FontManager.DEFAULT_FONT
or FontManager.DEFAULT_FIXED_FONT
is
returned, depending on the fixedFont
flag.