Package de.xima.fc.common.text.shape
Class FontSpecifier
- java.lang.Object
-
- de.xima.fc.common.text.shape.FontSpecifier
-
public final class FontSpecifier extends Object
A font specifier for the text shapers such asFontTextShaperBuilder.- Since:
- 8.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFontSpecifier.BuilderA builder forFontSpecifier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FontSpecifier.BuilderbyFileName(String fileName)Creates a new builder for a font specifier based on the file name.intcollectionIndex()Gets the collection index of the font.booleanequals(Object obj)inthashCode()Stringid()Gets the unique ID of the font.static FontSpecifier.BuilderopenType(String id)Creates a new builder for an OpenType font specifier.StringtoString()static FontSpecifier.BuildertrueType(String id)Creates a new builder for a TrueType font specifier.
-
-
-
Method Detail
-
collectionIndex
public int collectionIndex()
Gets the collection index of the font. -1 when not a collection.- Returns:
- The type of the font.
-
id
public String id()
Gets the unique ID of the font.- Returns:
- The type of the font.
-
byFileName
public static FontSpecifier.Builder byFileName(String fileName)
Creates a new builder for a font specifier based on the file name. The file name should include the extension, e.g. "LiberationMono-BoldItalic.ttf". The base name is used as the font ID, and the extension is used to determine the font type.- Parameters:
fileName- The file name of the font file.- Returns:
- A new builder for a font specifier.
-
openType
public static FontSpecifier.Builder openType(String id)
Creates a new builder for an OpenType font specifier.- Parameters:
id- The unique identifier of the font, including its style and variation, e.g. "LiberationMono-BoldItalic".- Returns:
- A new builder for an OpenType font specifier.
-
trueType
public static FontSpecifier.Builder trueType(String id)
Creates a new builder for a TrueType font specifier.- Parameters:
id- The unique identifier of the font, including its style and variation, e.g. "LiberationMono-BoldItalic".- Returns:
- A new builder for a TrueType font specifier.
-
-