Package com.teamten.font
Class FontManager
java.lang.Object
com.teamten.font.FontManager
- Direct Known Subclasses:
PdfBoxFontManager
Loads and manages fonts.
-
Constructor Summary
ConstructorsConstructorDescriptionFontManager
(@Nullable Config config, Function<TypefaceVariant, Font> fontLoader) A font manager that creates new fonts from the specified font loader. -
Method Summary
Modifier and TypeMethodDescriptionget
(Typeface typeface, FontVariant fontVariant) Utility method that callsget(TypefaceVariant)
with a newTypefaceVariant
object created from the two parameters.get
(Typeface typeface, FontVariant fontVariant, double fontSize) Utility method that callsget(TypefaceVariantSize)
with a newTypefaceVariant
object created from the two parameters.get
(TypefaceVariant typefaceVariant) Fetches a font.get
(TypefaceVariantSize typefaceVariantSize) Fetches a font, returning the font and size together.
-
Constructor Details
-
FontManager
A font manager that creates new fonts from the specified font loader. The font loader should throw an IllegalArgumentException if the font cannot be loaded.
-
-
Method Details
-
get
Fetches a font. The first time this is called for a particular font, the font is loaded.- Throws:
IllegalArgumentException
- if the font cannot be loaded.
-
get
Fetches a font, returning the font and size together.- Throws:
IllegalArgumentException
- if the font cannot be loaded.
-
get
Utility method that callsget(TypefaceVariant)
with a newTypefaceVariant
object created from the two parameters. -
get
Utility method that callsget(TypefaceVariantSize)
with a newTypefaceVariant
object created from the two parameters.
-