Class Font
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumFont.WeightEnum representing weights available to a font in PolyUI.
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final transient FloatletterSpacingprivate final transient FloatlineSpacingprivate final transient FontFamilyfamilyprivate final Booleanitalicprivate final Font.Weightweightprivate final StringresourcePathprivate final transient BooleanloadSync
-
Constructor Summary
Constructors Constructor Description Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family, Boolean italic, Font.Weight weight)Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family, Boolean italic)Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family)Font(String resourcePath, Float letterSpacing, Float lineSpacing)Font(String resourcePath, Float letterSpacing)Font(String resourcePath)
-
Method Summary
Modifier and Type Method Description final StringgetName()final FloatgetLetterSpacing()final FloatgetLineSpacing()final FontFamilygetFamily()final BooleangetItalic()final Font.WeightgetWeight()final FontgetAtStyle(Font.Weight weight, Boolean italic)IntegerhashCode()Booleanequals(Object other)final static Font.WeightbyWeight(Integer weight)Get a Weight instance given the integer weight, as specified by the Google Fonts CSS v2 API. -
Methods inherited from class org.polyfrost.polyui.renderer.data.Resource
bytes, getResourcePath, load, load, loadAsync, loadAsync, shouldLoadSync, stream, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Font
Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family, Boolean italic, Font.Weight weight)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)letterSpacing- The letter spacing of the font, in pixels (e.g.lineSpacing- The line spacing of the font, in proportion to the font size (e.g.family- a reference to the family that encloses this font.
-
Font
Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family, Boolean italic)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)letterSpacing- The letter spacing of the font, in pixels (e.g.lineSpacing- The line spacing of the font, in proportion to the font size (e.g.family- a reference to the family that encloses this font.
-
Font
Font(String resourcePath, Float letterSpacing, Float lineSpacing, FontFamily family)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)letterSpacing- The letter spacing of the font, in pixels (e.g.lineSpacing- The line spacing of the font, in proportion to the font size (e.g.family- a reference to the family that encloses this font.
-
Font
Font(String resourcePath, Float letterSpacing, Float lineSpacing)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)letterSpacing- The letter spacing of the font, in pixels (e.g.lineSpacing- The line spacing of the font, in proportion to the font size (e.g.
-
Font
Font(String resourcePath, Float letterSpacing)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)letterSpacing- The letter spacing of the font, in pixels (e.g.
-
Font
Font(String resourcePath)
- Parameters:
resourcePath- The resource of the font, can be a URL (see here, you should use this or an equivalent method)
-
-
Method Detail
-
getLetterSpacing
final Float getLetterSpacing()
-
getLineSpacing
final Float getLineSpacing()
-
getFamily
final FontFamily getFamily()
-
getWeight
final Font.Weight getWeight()
-
getAtStyle
final Font getAtStyle(Font.Weight weight, Boolean italic)
-
byWeight
final static Font.Weight byWeight(Integer weight)
Get a Weight instance given the integer weight, as specified by the Google Fonts CSS v2 API.
Weights that are not whole numbers will be floored to the nearest 100.
- Since:
1.0.7
-
-
-
-