public class FontUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FontUtils.FontType |
static class |
FontUtils.Size |
Constructor and Description |
---|
FontUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canChangeSize() |
static Font |
getFont(Font font,
FontUtils.Size size)
Gets the specified font with the specified size, correctly scaled
|
static Font |
getFont(Font font,
int style,
FontUtils.Size size)
Gets the specified font with the specified style and size, correctly scaled
|
static Font |
getFont(FontUtils.FontType fontType)
Gets the font for the give
FontUtils.FontType |
static Font |
getFont(FontUtils.Size size)
Gets the default font with the specified size, correctly scaled
|
static Font |
getFont(int style)
Gets the default font with the specified style, correctly scaled
|
static Font |
getFont(int style,
FontUtils.Size size)
Gets the default font with the specified style and size, correctly scaled
|
static Font |
getFont(String name)
Gets the named font, correctly scaled
|
static Font |
getFont(String name,
int style)
Gets the named font with the specified style, correctly scaled
|
static Font |
getFontWithFallback(FontUtils.FontType fontType,
String fallbackFontName)
Gets font for the given
FontUtils.FontType or the fallback font with the given name if no font
is set for the given FontType |
static Font |
getQuicksandBoldFont()
Returns the Quicksand Bold font -
https://fonts.google.com/specimen/Quicksand?selection.family=Quicksand
|
static float |
getScale() |
static Font |
getSystemDefaultFont() |
static boolean |
isDefaultFontSet()
Tells whether or not a custom default font was set.
|
static boolean |
isDefaultFontSet(FontUtils.FontType fontType)
Tells whether or not a custom default font was set for the given
FontUtils.FontType . |
static void |
setDefaultFont(FontUtils.FontType fontType,
Font font) |
static void |
setDefaultFont(FontUtils.FontType fontType,
String name,
int size) |
public static Font getSystemDefaultFont()
public static Font getQuicksandBoldFont()
public static boolean canChangeSize()
public static void setDefaultFont(FontUtils.FontType fontType, Font font)
public static void setDefaultFont(FontUtils.FontType fontType, String name, int size)
public static Font getFont(String name)
name
- public static Font getFont(int style)
style
- public static Font getFont(FontUtils.FontType fontType)
FontUtils.FontType
fontType
- the FontType
for which the font should be returnedpublic static Font getFontWithFallback(FontUtils.FontType fontType, String fallbackFontName)
FontUtils.FontType
or the fallback font with the given name if no font
is set for the given FontType
fontType
- the FontType
for which the font should be returnedfallbackFontName
- the name (String
) of the font which will be returned of no
font is set for the given FontType
public static Font getFont(String name, int style)
name
- style
- public static Font getFont(int style, FontUtils.Size size)
style
- size
- public static Font getFont(Font font, int style, FontUtils.Size size)
style
- size
- public static Font getFont(FontUtils.Size size)
size
- public static Font getFont(Font font, FontUtils.Size size)
font
- size
- public static float getScale()
public static boolean isDefaultFontSet()
If no custom font was set it's used the system default font.
true
if a custom font was set, false
otherwise.getSystemDefaultFont()
public static boolean isDefaultFontSet(FontUtils.FontType fontType)
FontUtils.FontType
.true
if a custom font was set, false
otherwise.getSystemDefaultFont()