Class FallbackFontStore
java.lang.Object
com.openhtmltopdf.pdfboxout.fontstore.FallbackFontStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<org.apache.fontbox.ttf.TrueTypeCollection> private final org.apache.pdfbox.pdmodel.PDDocument
private final FSCacheEx
<String, FSCacheValue> private final List
<PdfBoxFontResolver.FontDescription> -
Constructor Summary
ConstructorsConstructorDescriptionFallbackFontStore
(SharedContext sharedContext, org.apache.pdfbox.pdmodel.PDDocument doc, FSCacheEx<String, FSCacheValue> pdfMetricsCache) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addFont
(boolean subset, PdfBoxFontResolver.FontDescription descr) void
addFont
(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) void
addFont
(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) (package private) void
addFont
(org.apache.fontbox.ttf.TrueTypeFont trueTypeFont, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add a font using a FontBox TrueTypeFont.void
addFontCollection
(org.apache.fontbox.ttf.TrueTypeCollection collection, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) void
addFontLazy
(FSSupplier<org.apache.pdfbox.pdmodel.font.PDFont> font, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add a font with a lazy loaded PDFontvoid
close()
private int
getFamilyPriority
(String fontFamily, List<String> desiredFamilies) private int
getFontPriority
(PdfBoxFontResolver.FontDescription font, String[] families, IdentValue weight, IdentValue desiredStyle, IdentValue variant) resolveFonts
(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant)
-
Field Details
-
fonts
-
_collectionsToClose
-
_doc
private final org.apache.pdfbox.pdmodel.PDDocument _doc -
_fontMetricsCache
-
-
Constructor Details
-
Method Details
-
getFontPriority
private int getFontPriority(PdfBoxFontResolver.FontDescription font, String[] families, IdentValue weight, IdentValue desiredStyle, IdentValue variant) -
getFamilyPriority
-
addFont
public void addFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) -
addFont
public void addFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) -
addFontLazy
public void addFontLazy(FSSupplier<org.apache.pdfbox.pdmodel.font.PDFont> font, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add a font with a lazy loaded PDFont -
addFont
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
addFont
void addFont(org.apache.fontbox.ttf.TrueTypeFont trueTypeFont, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) throws IOException Add a font using a FontBox TrueTypeFont.- Throws:
IOException
-
addFontCollection
public void addFontCollection(org.apache.fontbox.ttf.TrueTypeCollection collection, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) throws IOException - Throws:
IOException
-