iText 8.0.5 API
iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy Class Referenceabstract

The class defines complex implementation of IFontSelectorStrategy which based on the following algorithm: 1. More...

Inheritance diagram for iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy:
iText.Layout.Font.Selectorstrategy.IFontSelectorStrategy iText.Layout.Font.Selectorstrategy.BestMatchFontSelectorStrategy iText.Layout.Font.Selectorstrategy.FirstMatchFontSelectorStrategy

Public Member Functions

  AbstractFontSelectorStrategy (FontProvider fontProvider, FontSelector fontSelector, FontSet additionalFonts)
  Creates a new instance of AbstractFontSelectorStrategy. More...
 
virtual IList< Tuple2< GlyphLine, PdfFont > >  GetGlyphLines (String text)
  Converts text into glyphs with the best matching font. More...
 

Package Functions

abstract bool  IsCurrentFontCheckRequired ()
  If it is necessary to provide a check that the best font for passed symbol equals to the current font. More...
 
virtual PdfFont  MatchFont (int codePoint, FontSelector fontSelector, FontProvider fontProvider, FontSet additionalFonts)
  Finds the best font which matches passed symbol. More...
 

Detailed Description

The class defines complex implementation of IFontSelectorStrategy which based on the following algorithm: 1.

The class defines complex implementation of IFontSelectorStrategy which based on the following algorithm:

  1. Find first significant symbol (not whitespace or special).
  2. Find font which matches symbol according to passed iText.Layout.Font.FontSelector.
  3. Try to append as many symbols as possible using the current font.
  4. If symbol is not matched to the current font, go to step 1.

Algorithm takes care of the case when there is no matched font for symbol or when diacritic from another font is used (previous symbol will be processed by diacritic's font).

Constructor & Destructor Documentation

◆ AbstractFontSelectorStrategy()

iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy.AbstractFontSelectorStrategy ( FontProvider  fontProvider,
FontSelector  fontSelector,
FontSet  additionalFonts 
)
inline

Creates a new instance of AbstractFontSelectorStrategy.

Parameters
fontProvider the font provider
fontSelector the font selector
additionalFonts the set of fonts to be used additionally to the fonts added to font provider.

Member Function Documentation

◆ GetGlyphLines()

virtual IList<Tuple2<GlyphLine, PdfFont> > iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy.GetGlyphLines ( String  text )
inlinevirtual

Converts text into glyphs with the best matching font.

Implements iText.Layout.Font.Selectorstrategy.IFontSelectorStrategy.

◆ IsCurrentFontCheckRequired()

abstract bool iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy.IsCurrentFontCheckRequired ( )
packagepure virtual

If it is necessary to provide a check that the best font for passed symbol equals to the current font.

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.

Returns

true if check is needed, otherwise false

Implemented in iText.Layout.Font.Selectorstrategy.FirstMatchFontSelectorStrategy, and iText.Layout.Font.Selectorstrategy.BestMatchFontSelectorStrategy.

◆ MatchFont()

virtual PdfFont iText.Layout.Font.Selectorstrategy.AbstractFontSelectorStrategy.MatchFont ( int  codePoint,
FontSelector  fontSelector,
FontProvider  fontProvider,
FontSet  additionalFonts 
)
inlinepackagevirtual

Finds the best font which matches passed symbol.

Parameters
codePoint the symbol to match
fontSelector the font selector
fontProvider the font provider
additionalFonts the addition fonts
Returns
font which matches the symbol