Class FontRegistry
java.lang.Object
ch.autumo.ui.utils.FontRegistry
Central registry for fonts loaded by the application.
Register each loaded font file so that concrete style names
(regular, bold, italic, bold-italic) can be resolved by family.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FontGet default font.static voidRegisters a loaded font as a concrete style of its family.static StringresolveName(Font baseFont, boolean bold, boolean italic) Resolves a concrete font name for the given base font and style.static voidsetDefault(Font defaultFont) Set default font.
-
Method Details
-
setDefault
Set default font.- Parameters:
defaultFont- default font
-
getDefault
-
register
Registers a loaded font as a concrete style of its family.- Parameters:
loadedFont- the font returned byFont.loadFont(String, double)
-
resolveName
Resolves a concrete font name for the given base font and style.- Parameters:
baseFont- the base font (provides family and size)bold- whether bold is requesteditalic- whether italic is requested- Returns:
- a concrete font name, or
nullif none is registered
-