Class FontTextShaperBuilder
java.lang.Object
de.xima.fc.common.text.shape.FontTextShaperBuilder
A builder for a
ITextShaper that uses an Aspose text shaper to measure text.
Harfbuzz to measure text.
- Since:
- 8.4.0
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new shaper with the current settings.Creates a new shaper with the current settings.fallbackFontFinder(IFallbackFontFinder fallbackFontFinder) Sets the finder for locating fallback fonts, in case the main font cannot render a piece of text.mainFont(FontSpecifier mainFont) Sets the main font to use for shaping text, overriding any previously set main font.textShaperType(TextShaperType textShaperType) Sets the text shaper implementation to use.useSharedFontFactory(boolean useSharedFontFactory) Sets whether to use a shared font factory for loading fonts.
-
Method Details
-
buildThreadSafe
Creates a new shaper with the current settings.- Returns:
- A new shaper.
-
buildThreadUnsafe
Creates a new shaper with the current settings. This shaper is not thread-safe and should not be used from multiple threads at the same time. In exchange, it might offer better performance, especially when reused.- Returns:
- A new shaper.
-
fallbackFontFinder
Sets the finder for locating fallback fonts, in case the main font cannot render a piece of text.- Parameters:
fallbackFontFinder- The fallback font finder to use.- Returns:
- This builder for chaining method calls.
-
mainFont
Sets the main font to use for shaping text, overriding any previously set main font.- Parameters:
mainFont- The main font to use.- Returns:
- This builder for chaining method calls.
-
textShaperType
Sets the text shaper implementation to use. This determines the details of how the text will be shaped.- Parameters:
textShaperType- The text shaper type to use, such as Harfbuzz or AWT.- Returns:
- This builder for chaining method calls.
-