Package com.itextpdf.layout.font
Class FontSelector
java.lang.Object
com.itextpdf.layout.font.FontSelector
Sort given set of fonts according to font name and style.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFontSelector
(Collection<FontInfo> allFonts, List<String> fontFamilies, FontCharacteristics fc) Create new FontSelector instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal FontInfo
The best font match.protected Comparator<FontInfo>
getComparator
(List<String> fontFamilies, FontCharacteristics fc) getFonts()
Sorted set of fonts.
-
Field Details
-
fonts
-
-
Constructor Details
-
FontSelector
public FontSelector(Collection<FontInfo> allFonts, List<String> fontFamilies, FontCharacteristics fc) Create new FontSelector instance.- Parameters:
-
allFonts
- unsorted set of all available fonts. -
fontFamilies
- sorted list of preferred font families. -
fc
- instance ofFontCharacteristics
.
-
-
Method Details
-
bestMatch
The best font match. If any font fromgetFonts()
doesn't contain requested glyphs, this font will be used.- Returns:
- the best matched font
-
getFonts
Sorted set of fonts.- Returns:
- sorted set of fonts
-
getComparator
-