Class Font
-
-
Field Summary
Fields Modifier and Type Field Description private final transient Stringnameprivate final FloatletterSpacingprivate final FloatlineSpacingprivate final transient Booleaninitprivate final transient Booleanresettableprivate final InputStreamstreamprivate final StringresourcePath
-
Method Summary
Modifier and Type Method Description final StringgetName()final FloatgetLetterSpacing()final FloatgetLineSpacing()IntegerhashCode()Booleanequals(Object other)final static FontgetGoogleFont(String family, String style, Float letterSpacing, Float lineSpacing, Boolean verify)Get a font from the Google Fonts repository on GitHub. final static FontgetGoogleFont(String family, String style, Float letterSpacing, Float lineSpacing)Get a font from the Google Fonts repository on GitHub. final static FontgetGoogleFont(String family, String style, Float letterSpacing)Get a font from the Google Fonts repository on GitHub. final static FontgetGoogleFont(String family, String style)Get a font from the Google Fonts repository on GitHub. -
Methods inherited from class org.polyfrost.polyui.renderer.data.Resource
close, get, getAsync, getAsyncNullable, getInit, getResettable, getResourcePath, getStream, reset, 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)
- 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()
-
getGoogleFont
@JvmOverloads() final static Font getGoogleFont(String family, String style, Float letterSpacing, Float lineSpacing, Boolean verify)
Get a font from the Google Fonts repository on GitHub.
Note that each font has a different licence, so it's best to check the licence for your usage.
Set verify to
trueto attempt to connect to the mirror in this method for a better error message.- Parameters:
family- the name of the font, for examplepoppinsorroboto.style- the style of the font.- Since:
0.16.0
-
getGoogleFont
@JvmOverloads() final static Font getGoogleFont(String family, String style, Float letterSpacing, Float lineSpacing)
Get a font from the Google Fonts repository on GitHub.
Note that each font has a different licence, so it's best to check the licence for your usage.
Set verify to
trueto attempt to connect to the mirror in this method for a better error message.- Parameters:
family- the name of the font, for examplepoppinsorroboto.style- the style of the font.- Since:
0.16.0
-
getGoogleFont
@JvmOverloads() final static Font getGoogleFont(String family, String style, Float letterSpacing)
Get a font from the Google Fonts repository on GitHub.
Note that each font has a different licence, so it's best to check the licence for your usage.
Set verify to
trueto attempt to connect to the mirror in this method for a better error message.- Parameters:
family- the name of the font, for examplepoppinsorroboto.style- the style of the font.- Since:
0.16.0
-
getGoogleFont
@JvmOverloads() final static Font getGoogleFont(String family, String style)
Get a font from the Google Fonts repository on GitHub.
Note that each font has a different licence, so it's best to check the licence for your usage.
Set verify to
trueto attempt to connect to the mirror in this method for a better error message.- Parameters:
family- the name of the font, for examplepoppinsorroboto.style- the style of the font.- Since:
0.16.0
-
-
-
-