Class FontSelector
Sort given set of fonts according to font name and style.
public class FontSelector
- Inheritance
-
FontSelector
- Inherited Members
Constructors
FontSelector(ICollection<FontInfo>, IList<string>, FontCharacteristics)
Create new FontSelector instance.
public FontSelector(ICollection<FontInfo> allFonts, IList<string> fontFamilies, FontCharacteristics fc)
Parameters
allFonts
ICollection<FontInfo>unsorted set of all available fonts.
fontFamilies
IList<string>sorted list of preferred font families.
fc
FontCharacteristicsinstance of FontCharacteristics.
Fields
fonts
protected IList<FontInfo> fonts
Field Value
Methods
BestMatch()
The best font match.
public FontInfo BestMatch()
Returns
- FontInfo
the best matched font
Remarks
The best font match. If any font from GetFonts() doesn't contain requested glyphs, this font will be used.
GetComparator(IList<string>, FontCharacteristics)
protected virtual IComparer<FontInfo> GetComparator(IList<string> fontFamilies, FontCharacteristics fc)
Parameters
fontFamilies
IList<string>fc
FontCharacteristics
Returns
GetFonts()
Sorted set of fonts.
public IEnumerable<FontInfo> GetFonts()
Returns
- IEnumerable<FontInfo>
sorted set of fonts