Class AbstractFontSelectorStrategy
- Namespace
- iText.Layout.Font.Selectorstrategy
- Assembly
- itext.layout.dll
The class defines complex implementation of IFontSelectorStrategy which based on the following algorithm: 1.
public abstract class AbstractFontSelectorStrategy : IFontSelectorStrategy
- Inheritance
-
AbstractFontSelectorStrategy
- Implements
- Derived
- Inherited Members
Remarks
The class defines complex implementation of IFontSelectorStrategy which based on the following algorithm:
- Find first significant symbol (not whitespace or special).
- Find font which matches symbol according to passed FontSelector.
- Try to append as many symbols as possible using the current font.
- If symbol is not matched to the current font, go to step 1.
Constructors
AbstractFontSelectorStrategy(FontProvider, FontSelector, FontSet)
Creates a new instance of AbstractFontSelectorStrategy.
public AbstractFontSelectorStrategy(FontProvider fontProvider, FontSelector fontSelector, FontSet additionalFonts)
Parameters
fontProvider
FontProviderthe font provider
fontSelector
FontSelectorthe font selector
additionalFonts
FontSetthe set of fonts to be used additionally to the fonts added to font provider.
Methods
GetGlyphLines(string)
public virtual IList<Tuple2<GlyphLine, PdfFont>> GetGlyphLines(string text)
Parameters
text
string
Returns
IsCurrentFontCheckRequired()
If it is necessary to provide a check that the best font for passed symbol equals to the current font.
protected abstract bool IsCurrentFontCheckRequired()
Returns
Remarks
If it is necessary to provide a check that the best font for passed symbol equals to the current font. Result of checking is used to split text into parts in case if inequality.
MatchFont(int, FontSelector, FontProvider, FontSet)
Finds the best font which matches passed symbol.
protected virtual PdfFont MatchFont(int codePoint, FontSelector fontSelector, FontProvider fontProvider, FontSet additionalFonts)
Parameters
codePoint
intthe symbol to match
fontSelector
FontSelectorthe font selector
fontProvider
FontProviderthe font provider
additionalFonts
FontSetthe addition fonts
Returns
- PdfFont
font which matches the symbol