Package de.xima.fc.common.text.shape
Class FontSpecifier.Builder
- java.lang.Object
-
- de.xima.fc.common.text.shape.FontSpecifier.Builder
-
- Enclosing class:
- FontSpecifier
public static final class FontSpecifier.Builder extends Object
A builder forFontSpecifier.- Since:
- 8.4.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontSpecifierbuild()Creates a new font specifier from the current settings.FontSpecifier.BuildercollectionIndex(int collectionIndex)If the input is a font collection (*.otc or *.ttc), sets the collection index to select the font to use.FontSpecifier.Builderdata(IThrowingSupplier<InputStream> data)Sets the input stream of the font data.FontSpecifier.Builderdata(String path)Sets the path of the input font file.FontSpecifier.Builderdata(Path path)Sets the path of the input font file.FontSpecifier.BuilderfeatureContextualLigatures()Enables the font feature for contextual ligatures.FontSpecifier.BuilderfeatureDiscretionaryLigatures()Enables the font feature for discretionary ligatures.FontSpecifier.BuilderfeatureGlyphCompositionDecomposition()Enables the font feature for glyph composition and decomposition.FontSpecifier.BuilderfeatureHistoricalLigatures()Enables the font feature for historical ligatures.FontSpecifier.BuilderfeatureKerning()Enables the font feature for kerning.FontSpecifier.BuilderfeatureLiningFigures()Enables the font feature for lining figures.FontSpecifier.BuilderfeatureOldStyleFigures()Enables the font feature for old style figures.FontSpecifier.BuilderfeatureProportionalFigures()Enables the font feature for proportional figures.FontSpecifier.BuilderfeatureRequiredLigatures()Enables the font feature for required ligatures.FontSpecifier.BuilderfeatureStandardLigatures()Enables the font feature for standard ligatures.FontSpecifier.BuilderfeatureStylisticSet(int stylisticSet)Enables the font feature for a certain stylistic set.FontSpecifier.BuilderfeatureTabularFigures()Enables the font feature for tabular figures.FontSpecifier.BuilderfeatureVerticalAlternates()Enables the font feature for vertical alternates.FontSpecifier.BuilderfeatureVerticalAlternatesAndRotation()Enables the font feature for vertical alternates and rotation.
-
-
-
Method Detail
-
build
public FontSpecifier build()
Creates a new font specifier from the current settings.- Returns:
- A new font specifier.
-
collectionIndex
public FontSpecifier.Builder collectionIndex(int collectionIndex)
If the input is a font collection (*.otc or *.ttc), sets the collection index to select the font to use.- Parameters:
collectionIndex- The index of the font in the collection. Must be >= 0.- Returns:
- This builder for chaining method calls.
-
data
public FontSpecifier.Builder data(String path)
Sets the path of the input font file. This is required.- Parameters:
path- The path of the input font file. Must not be null.- Returns:
- This builder for chaining method calls.
-
data
public FontSpecifier.Builder data(Path path)
Sets the path of the input font file. This is required.- Parameters:
path- The path of the input font file. Must not be null.- Returns:
- This builder for chaining method calls.
-
data
public FontSpecifier.Builder data(IThrowingSupplier<InputStream> data)
Sets the input stream of the font data. This is required.- Parameters:
data- The supplier for the input stream of the font data. Must not be null.- Returns:
- This builder for chaining method calls.
-
featureContextualLigatures
public FontSpecifier.Builder featureContextualLigatures()
Enables the font feature for contextual ligatures.- Returns:
- This builder for chaining method calls.
-
featureDiscretionaryLigatures
public FontSpecifier.Builder featureDiscretionaryLigatures()
Enables the font feature for discretionary ligatures.- Returns:
- This builder for chaining method calls.
-
featureGlyphCompositionDecomposition
public FontSpecifier.Builder featureGlyphCompositionDecomposition()
Enables the font feature for glyph composition and decomposition.- Returns:
- This builder for chaining method calls.
-
featureHistoricalLigatures
public FontSpecifier.Builder featureHistoricalLigatures()
Enables the font feature for historical ligatures.- Returns:
- This builder for chaining method calls.
-
featureKerning
public FontSpecifier.Builder featureKerning()
Enables the font feature for kerning.- Returns:
- This builder for chaining method calls.
-
featureLiningFigures
public FontSpecifier.Builder featureLiningFigures()
Enables the font feature for lining figures.- Returns:
- This builder for chaining method calls.
-
featureOldStyleFigures
public FontSpecifier.Builder featureOldStyleFigures()
Enables the font feature for old style figures.- Returns:
- This builder for chaining method calls.
-
featureProportionalFigures
public FontSpecifier.Builder featureProportionalFigures()
Enables the font feature for proportional figures.- Returns:
- This builder for chaining method calls.
-
featureRequiredLigatures
public FontSpecifier.Builder featureRequiredLigatures()
Enables the font feature for required ligatures.- Returns:
- This builder for chaining method calls.
-
featureStandardLigatures
public FontSpecifier.Builder featureStandardLigatures()
Enables the font feature for standard ligatures.- Returns:
- This builder for chaining method calls.
-
featureStylisticSet
public FontSpecifier.Builder featureStylisticSet(int stylisticSet)
Enables the font feature for a certain stylistic set.- Parameters:
stylisticSet- The stylistic set to enable. Must be between 1 and 20.- Returns:
- This builder for chaining method calls.
-
featureTabularFigures
public FontSpecifier.Builder featureTabularFigures()
Enables the font feature for tabular figures.- Returns:
- This builder for chaining method calls.
-
featureVerticalAlternates
public FontSpecifier.Builder featureVerticalAlternates()
Enables the font feature for vertical alternates.- Returns:
- This builder for chaining method calls.
-
featureVerticalAlternatesAndRotation
public FontSpecifier.Builder featureVerticalAlternatesAndRotation()
Enables the font feature for vertical alternates and rotation.- Returns:
- This builder for chaining method calls.
-
-