public class FontProvider extends Object
FontSet
and collection of PdfFont
s. FontProvider depends from PdfDocument
, due to PdfFont
, it cannot be reused for different documents, but a new instance of FontProvider could be created with getFontSet()
. FontProvider the only end point for creating PdfFont, getPdfFont(FontInfo)
, FontInfo
shall call this method.
Note, FontProvider does not close created FontProgram
s, because of possible conflicts with FontCache
.
Constructor and Description |
---|
FontProvider() |
FontProvider(FontSet fontSet) |
public FontProvider(FontSet fontSet)
public FontProvider()
public boolean addFont(FontProgram fontProgram, String encoding)
public boolean addFont(byte[] fontProgram, String encoding)
public boolean addFont(String fontProgram)
public boolean addFont(FontProgram fontProgram)
public boolean addFont(byte[] fontProgram)
public int addDirectory(String dir)
public int addSystemFonts()
public int addStandardPdfFonts()
public FontSet getFontSet()
public String getDefaultEncoding(FontProgram fontProgram)
public boolean getDefaultCacheFlag()
public boolean getDefaultEmbeddingFlag()
public FontSelectorStrategy getStrategy(String text, List<String> fontFamilies, FontCharacteristics fc)
public FontSelectorStrategy getStrategy(String text, List<String> fontFamilies)
public final FontSelector getFontSelector(List<String> fontFamilies, FontCharacteristics fc)
FontSelector
or get from cache.
fontFamilies
- target font families
fc
- instance of FontCharacteristics
.
FontSelector
.
}
protected FontSelector createFontSelector(Set<FontInfo> fonts, List<String> fontFamilies, FontCharacteristics fc)
FontSelector
. While caching is main responsibility of getFontSelector(List, FontCharacteristics)
, this method just create a new instance of FontSelector
.
fonts
- Set of all available fonts in current context.
fontFamilies
- target font families
fc
- instance of FontCharacteristics
.
FontSelector
.
protected PdfFont getPdfFont(FontInfo fontInfo) throws IOException
PdfFont
.
fontInfo
- font info, to create FontProgram
and PdfFont
.
PdfFont
.
IOException
- on I/O exceptions in FontProgramFactory
.
Copyright © 1998–2017 iText Group NV. All rights reserved.