Package com.luciad.text
Class FontConfig.Builder
java.lang.Object
com.luciad.text.FontConfig.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
FontConfig
This builder allows you to create a
FontConfig
instance that can be registered using Fonts#registerFont
.- Since:
- 2024.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theFontConfig
.void
close()
Add a font file to the font configuration.protected void
finalize()
Sets the unique identifier of the font, which is used in other functions to specify which font to use, for example inTextStyle
.
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Builds theFontConfig
.- Returns:
- A
FontConfig
object that can be registered for use. - Throws:
IllegalStateException
- If not all mandatory parameters are set.IllegalStateException
- If not all mandatory parameters are set.
-
name
Sets the unique identifier of the font, which is used in other functions to specify which font to use, for example inTextStyle
.Registering a font name that is already in use overwrites it, this includes the fonts available by default.
This function is mandatory.
- Parameters:
name
- identifier of the font.- Returns:
- this builder.
-
file
Add a font file to the font configuration.In many cases only one file is needed.
You can, for example, call this function multiple times if you have a bitmap font where each size is in a different file.
This function is mandatory.
- Parameters:
path
- path to a font file.- Returns:
- this builder.
-