Class MainFontStore
java.lang.Object
com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore
com.openhtmltopdf.pdfboxout.fontstore.MainFontStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore
AbstractFontStore.BuiltinFontStore, AbstractFontStore.EmptyFontStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<org.apache.fontbox.ttf.TrueTypeCollection> private final org.apache.pdfbox.pdmodel.PDDocument
private final Map
<String, FontFamily<PdfBoxFontResolver.FontDescription>> private final FSCacheEx
<String, FSCacheValue> private final SharedContext
-
Constructor Summary
ConstructorsConstructorDescriptionMainFontStore
(SharedContext sharedContext, org.apache.pdfbox.pdmodel.PDDocument doc, FSCacheEx<String, FSCacheValue> pdfMetricsCache) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Add fonts using a FontBox TrueTypeCollection.void
addFontFaceFont
(String fontFamilyName, IdentValue fontWeight, IdentValue fontStyle, String uri, 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 PDFontprivate void
addFontToFamily
(boolean subset, FontFamily<PdfBoxFontResolver.FontDescription> fontFamily, PdfBoxFontResolver.FontDescription descr) void
close()
getFontFamily
(String fontFamilyName) resolveFont
(SharedContext ctx, String fontFamily, float size, IdentValue weight, IdentValue style, IdentValue variant)
-
Field Details
-
_fontFamilies
-
_fontMetricsCache
-
_doc
private final org.apache.pdfbox.pdmodel.PDDocument _doc -
_collectionsToClose
-
-
Constructor Details
-
Method Details
-
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
-
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 -
addFontCollection
public void addFontCollection(org.apache.fontbox.ttf.TrueTypeCollection collection, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) throws IOException Add fonts using a FontBox TrueTypeCollection.- Throws:
IOException
-
addFontFaceFont
public void addFontFaceFont(String fontFamilyName, IdentValue fontWeight, IdentValue fontStyle, String uri, boolean subset) -
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) -
addFontToFamily
private void addFontToFamily(boolean subset, FontFamily<PdfBoxFontResolver.FontDescription> fontFamily, PdfBoxFontResolver.FontDescription descr) -
getFontFamily
-