Top Description Fields Constructors Methods
org.controlsfx.glyphfont

public final Class GlyphFontRegistry

extends Object
Class Inheritance
Imports
java.io.InputStream, java.util.HashMap, .Map, .ServiceLoader

The glyph font registry automatically registers available fonts using a ServiceLoader facility, however it is also possible to register glyph fonts manually using the provided GlyphFontRegistry#register(GlyphFont) method.

Once registered, fonts can be requested by name using the GlyphFontRegistry#font(String) method. Please refer to the GlyphFont documentation to learn how to use a font.

Field Summary

Modifier and TypeField and Description
private static Map<String, GlyphFont>
fontMap

* Private fields * *

Constructor Summary

AccessConstructor and Description
private
GlyphFontRegistry()

Private constructor since static class

Method Summary

Modifier and TypeMethod and Description
public static GlyphFont

Returns:

font or null if not found
font
(String
family name of the font
familyName
)

Retrieve font by its family name

public static void
register(String
The name of this font.
familyName
,
String
The location where it can be loaded from.
uri
,
int
The default font size
defaultSize
)

Registers the specified font as default GlyphFont

public static void
register(String
The name of this font.
familyName
,
InputStream
Inputstream of the font data
in
,
int
The default font size
defaultSize
)

Registers the specified font as default GlyphFont

public static void
register(GlyphFont font)

Registers the specified font

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontMapback to summary
private static Map<String, GlyphFont> fontMap

* Private fields * *

Constructor Detail

GlyphFontRegistryback to summary
private GlyphFontRegistry()

Private constructor since static class

Method Detail

fontback to summary
public static GlyphFont font(String familyName)

Retrieve font by its family name

Parameters
familyName:String

family name of the font

Returns:GlyphFont

font or null if not found

registerback to summary
public static void register(String familyName, String uri, int defaultSize)

Registers the specified font as default GlyphFont

Parameters
familyName:String

The name of this font.

uri:String

The location where it can be loaded from.

defaultSize:int

The default font size

registerback to summary
public static void register(String familyName, InputStream in, int defaultSize)

Registers the specified font as default GlyphFont

Parameters
familyName:String

The name of this font.

in:InputStream

Inputstream of the font data

defaultSize:int

The default font size

registerback to summary
public static void register(GlyphFont font)

Registers the specified font