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 AbstractFontStore
AbstractFontStore.BuiltinFontStore, AbstractFontStore.EmptyFontStore -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<org.apache.fontbox.ttf.TrueTypeCollection> private final org.apache.pdfbox.pdmodel.PDDocumentprivate 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 TypeMethodDescriptionvoidaddFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) voidaddFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) (package private) voidaddFont(org.apache.fontbox.ttf.TrueTypeFont trueTypeFont, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add a font using a FontBox TrueTypeFont.voidaddFontCollection(org.apache.fontbox.ttf.TrueTypeCollection collection, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add fonts using a FontBox TrueTypeCollection.voidaddFontFaceFont(String fontFamilyName, IdentValue fontWeight, IdentValue fontStyle, String uri, boolean subset) voidaddFontLazy(FSSupplier<org.apache.pdfbox.pdmodel.font.PDFont> font, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset) Add a font with a lazy loaded PDFontprivate voidaddFontToFamily(boolean subset, FontFamily<PdfBoxFontResolver.FontDescription> fontFamily, PdfBoxFontResolver.FontDescription descr) voidclose()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:
closein interfaceAutoCloseable- Specified by:
closein 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
-