iText 8.0.5 API
iText.Layout.Font.FontSelector Class Reference

Sort given set of fonts according to font name and style. More...

Public Member Functions

  FontSelector (ICollection< FontInfo > allFonts, IList< String > fontFamilies, FontCharacteristics fc)
  Create new FontSelector instance. More...
 
FontInfo  BestMatch ()
  The best font match. More...
 
IEnumerable< FontInfo GetFonts ()
  Sorted set of fonts. More...
 

Package Functions

virtual IComparer< FontInfo GetComparator (IList< String > fontFamilies, FontCharacteristics fc)
 

Package Attributes

IList< FontInfo fonts
 

Detailed Description

Sort given set of fonts according to font name and style.

Constructor & Destructor Documentation

◆ FontSelector()

iText.Layout.Font.FontSelector.FontSelector ( ICollection< FontInfo allFonts,
IList< String >  fontFamilies,
FontCharacteristics  fc 
)
inline

Create new FontSelector instance.

Parameters
allFonts unsorted set of all available fonts.
fontFamilies sorted list of preferred font families.
fc instance of FontCharacteristics.

Member Function Documentation

◆ BestMatch()

FontInfo iText.Layout.Font.FontSelector.BestMatch ( )
inline

The best font match.

The best font match. If any font from GetFonts() doesn't contain requested glyphs, this font will be used.

Returns
the best matched font

◆ GetFonts()

IEnumerable<FontInfo> iText.Layout.Font.FontSelector.GetFonts ( )
inline

Sorted set of fonts.

Returns
sorted set of fonts