| Modifier and Type | Class and Description |
|---|---|
| private static class | PdfBoxFontResolver.
Loads a Type0 font on demand |
| public static class | PdfBoxFontResolver.
A |
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final AbstractFontStore | |
| private final PDDocument | |
| private final FallbackFontStore | |
| private final FallbackFontStore | |
| private final MainFontStore |
| Access | Constructor and Description |
|---|---|
| public | PdfBoxFontResolver(SharedContext sharedContext, PDDocument doc, FSCacheEx<String, FSCacheValue> pdfMetricsCache, PdfRendererBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addFont(File fontFile, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver.
Add a font file (truetype) to a specific font group. |
| public void | addFont(File fontFile, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset)
Add a font using a existing file. |
| public void | addFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver.
Adds a font specified by an input stream (truetype) to a specific font group. |
| public void | addFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset)
Add a font using a InputStream. |
| public void | addFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver.
Add a font specified by a PDFontSupplier to a specific font group. |
| public void | addFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset)
Add a font using a PDFontSupplier. |
| public void | addFontCollection(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver.
Adds a font collection (.ttc in an input stream) to a specific font group. |
| public void | addFontCollection(FSSupplier<InputStream> supplier, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset)
Add fonts using a .ttc TrueTypeCollection |
| public void | addFontCollection(File file, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver.
Adds a font collection (.ttc file) to a specific group. |
| public void | addFontCollection(File file, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset)
Add fonts using a .ttc TrueTypeCollection |
| public void | addFontDirectory(String dir, boolean embedded)
Deprecated
Use
addFontDirectory(String, boolean, FontGroup)
|
| public void | addFontDirectory(String dir, boolean embedded, PdfBoxFontResolver.
Add all fonts in the given directory |
| public void | |
| private FallbackFontStore | |
| public void | |
| private void | resolveFamilyFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant, List<PdfBoxFontResolver.
|
| public FSFont | resolveFont(SharedContext renderingContext, FontSpecification spec)
Implements com.
|
| private FSFont | resolveFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant)
|
| _builtinFonts | back to summary |
|---|---|
| private final AbstractFontStore _builtinFonts | |
| _doc | back to summary |
|---|---|
| private final PDDocument _doc | |
| _finalFallbackFonts | back to summary |
|---|---|
| private final FallbackFontStore _finalFallbackFonts | |
| _preBuiltinFallbackFonts | back to summary |
|---|---|
| private final FallbackFontStore _preBuiltinFallbackFonts | |
| _suppliedFonts | back to summary |
|---|---|
| private final MainFontStore _suppliedFonts | |
| PdfBoxFontResolver | back to summary |
|---|---|
| public PdfBoxFontResolver(SharedContext sharedContext, PDDocument doc, FSCacheEx<String, FSCacheValue> pdfMetricsCache, PdfRendererBuilder. | |
| addFont | back to summary |
|---|---|
| public void addFont(File fontFile, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver. Add a font file (truetype) to a specific font group. | |
| addFont | back to summary |
|---|---|
| public void addFont(File fontFile, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset) throws IOException
Add a font using a existing file. If the file is a TrueTypeCollection, it will be handled as such.
| |
| addFont | back to summary |
|---|---|
| public void addFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver. Adds a font specified by an input stream (truetype) to a specific font group. | |
| addFont | back to summary |
|---|---|
| public void addFont(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset)
Add a font using a InputStream. The given file must be a TrueType Font
(.ttf). If you know the underlying stream is a .ttc file you should use
| |
| addFont | back to summary |
|---|---|
| public void addFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver. Add a font specified by a PDFontSupplier to a specific font group. | |
| addFont | back to summary |
|---|---|
| public void addFont(PDFontSupplier supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset)
Add a font using a PDFontSupplier. Use this method if you need special rules for font-loading (like using a font-cache)
and subclass the
| |
| addFontCollection | back to summary |
|---|---|
| public void addFontCollection(FSSupplier<InputStream> supplier, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver. Adds a font collection (.ttc in an input stream) to a specific font group. | |
| addFontCollection | back to summary |
|---|---|
| public void addFontCollection(FSSupplier<InputStream> supplier, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset) throws IOException
Add fonts using a .ttc TrueTypeCollection
| |
| addFontCollection | back to summary |
|---|---|
| public void addFontCollection(File file, String fontFamilyNameOverride, Integer fontWeightOverride, IdentValue fontStyleOverride, boolean subset, PdfBoxFontResolver. Adds a font collection (.ttc file) to a specific group. | |
| addFontCollection | back to summary |
|---|---|
| public void addFontCollection(File file, final String fontFamilyNameOverride, final Integer fontWeightOverride, final IdentValue fontStyleOverride, final boolean subset) throws IOException
Add fonts using a .ttc TrueTypeCollection
| |
| addFontDirectory | back to summary |
|---|---|
| public void addFontDirectory(String dir, boolean embedded) throws IOException
Deprecated
| |
| addFontDirectory | back to summary |
|---|---|
| public void addFontDirectory(String dir, boolean embedded, PdfBoxFontResolver. Add all fonts in the given directory | |
| close | back to summary |
|---|---|
| public void close() Free all font resources (i.e. open files), the document should already be closed. | |
| getFallbackFontStore | back to summary |
|---|---|
| private FallbackFontStore getFallbackFontStore(PdfBoxFontResolver. | |
| importFontFaces | back to summary |
|---|---|
| public void importFontFaces(List<FontFaceRule> fontFaces) | |
| resolveFamilyFont | back to summary |
|---|---|
| private void resolveFamilyFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant, List<PdfBoxFontResolver. | |
| resolveFont | back to summary |
|---|---|
| public FSFont resolveFont(SharedContext renderingContext, FontSpecification spec) Implements com.
| |
| resolveFont | back to summary |
|---|---|
| private FSFont resolveFont(SharedContext ctx, String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant) | |
| Modifier and Type | Field and Description |
|---|---|
| private final PDDocument | |
| private final File |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PDFont |
| _doc | back to summary |
|---|---|
| private final PDDocument _doc | |
| _fontFile | back to summary |
|---|---|
| private final File _fontFile | |
| FilePDFontSupplier | back to summary |
|---|---|
| pack-priv FilePDFontSupplier(File fontFile, PDDocument doc) | |
| supply | back to summary |
|---|---|
| public PDFont supply() Implements com.
| |
FontDescription can exist in multiple states. Firstly the font may
or may not be realized. Fonts are automatically realized upon calling getFont()
Secondly, the metrics may or may not be available. If not available, you can attempt
to retrieve them by realizing the font.
| Modifier and Type | Field and Description |
|---|---|
| private final PDDocument | |
| private final String | |
| private PDFont | |
| private FSSupplier | |
| private final boolean | |
| private final boolean | |
| private PdfBoxRawPDFontMetrics | |
| private final FSCacheEx | |
| private final IdentValue | |
| private FSSupplier | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | FontDescription(PDFont font, IdentValue style, int weight)
Create a font description from one of the PDF built-in fonts. |
| public | FontDescription(PDDocument doc, FSSupplier<InputStream> supplier, int weight, IdentValue style, String family, boolean isFromFontFace, boolean isSubset, FSCacheEx<String, FSCacheValue> metricsCache)
Create a font description from an input stream supplier. |
| private | FontDescription(PDDocument doc, PDFont font, IdentValue style, int weight)
Create a font description when a PDFont is definitely available to begin with. |
| public | FontDescription(PDDocument doc, FSSupplier<PDFont> fontSupplier, IdentValue style, int weight, String family, boolean isFromFontFace, boolean isSubset, FSCacheEx<String, FSCacheValue> metricsCache)
Creates a font description from a PDFont supplier. |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| public String | |
| public PDFont | Returns: the font or null if there was a problem.Downloads and parses the font if required. |
| public PdfBoxRawPDFontMetrics | Returns: the font metrics or null if there was a problem.Downloads and parses the font if required (metrics were not available from cache). |
| private PdfBoxRawPDFontMetrics | |
| public IdentValue | |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| private boolean | |
| private void | |
| public boolean | |
| public String |
| _doc | back to summary |
|---|---|
| private final PDDocument _doc | |
| _family | back to summary |
|---|---|
| private final String _family | |
| _font | back to summary |
|---|---|
| private PDFont _font | |
| _fontSupplier | back to summary |
|---|---|
| private FSSupplier<PDFont> _fontSupplier | |
| _isFromFontFace | back to summary |
|---|---|
| private final boolean _isFromFontFace | |
| _isSubset | back to summary |
|---|---|
| private final boolean _isSubset | |
| _metrics | back to summary |
|---|---|
| private PdfBoxRawPDFontMetrics _metrics | |
| _metricsCache | back to summary |
|---|---|
| private final FSCacheEx<String, FSCacheValue> _metricsCache | |
| _style | back to summary |
|---|---|
| private final IdentValue _style | |
| _supplier | back to summary |
|---|---|
| private FSSupplier<InputStream> _supplier | |
| _weight | back to summary |
|---|---|
| private final int _weight | |
| FontDescription | back to summary |
|---|---|
| public FontDescription(PDFont font, IdentValue style, int weight) Create a font description from one of the PDF built-in fonts. | |
| FontDescription | back to summary |
|---|---|
| public FontDescription(PDDocument doc, FSSupplier<InputStream> supplier, int weight, IdentValue style, String family, boolean isFromFontFace, boolean isSubset, FSCacheEx<String, FSCacheValue> metricsCache) Create a font description from an input stream supplier.
The input stream will only be accessed if | |
| FontDescription | back to summary |
|---|---|
| private FontDescription(PDDocument doc, PDFont font, IdentValue style, int weight) Create a font description when a PDFont is definitely available to begin with. Currently only used for PDF built-in fonts. | |
| FontDescription | back to summary |
|---|---|
| public FontDescription(PDDocument doc, FSSupplier<PDFont> fontSupplier, IdentValue style, int weight, String family, boolean isFromFontFace, boolean isSubset, FSCacheEx<String, FSCacheValue> metricsCache) Creates a font description from a PDFont supplier. The supplier will only be called upon
if | |
| createFontMetricsCacheKey | back to summary |
|---|---|
| private String createFontMetricsCacheKey(String family, int weight, IdentValue style) | |
| getFamily | back to summary |
|---|---|
| public String getFamily() | |
| getFont | back to summary |
|---|---|
| public PDFont getFont() Downloads and parses the font if required. Should only be called when the font is definitely needed.
| |
| getFontMetrics | back to summary |
|---|---|
| public PdfBoxRawPDFontMetrics getFontMetrics() Downloads and parses the font if required (metrics were not available from cache). Should only be called when the font metrics are definitely needed.
| |
| getFontMetricsFromCache | back to summary |
|---|---|
| private PdfBoxRawPDFontMetrics getFontMetricsFromCache(String family, int weight, IdentValue style) | |
| getStyle | back to summary |
|---|---|
| public IdentValue getStyle() Implements com.
| |
| getWeight | back to summary |
|---|---|
| public int getWeight() Implements com.
| |
| isFontAvailable | back to summary |
|---|---|
| public boolean isFontAvailable() Returns whether the font is available yet.
| |
| isFromFontFace | back to summary |
|---|---|
| public boolean isFromFontFace() | |
| isMetricsAvailable | back to summary |
|---|---|
| public boolean isMetricsAvailable() If the metrics are available yet.
| |
| loadMetrics | back to summary |
|---|---|
| private boolean loadMetrics() | |
| putFontMetricsInCache | back to summary |
|---|---|
| private void putFontMetricsInCache(String family, int weight, IdentValue style, PdfBoxRawPDFontMetrics metrics) | |
| realizeFont | back to summary |
|---|---|
| public boolean realizeFont() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| public static final PdfBoxFontResolver. | |
| public static final PdfBoxFontResolver. | |
| public static final PdfBoxFontResolver. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PdfBoxFontResolver. | |
| public static PdfBoxFontResolver. |
| FINAL_FALLBACK | back to summary |
|---|---|
| public static final PdfBoxFontResolver. | |
| MAIN | back to summary |
|---|---|
| public static final PdfBoxFontResolver. | |
| PRE_BUILT_IN_FALLBACK | back to summary |
|---|---|
| public static final PdfBoxFontResolver. | |
| FontGroup | back to summary |
|---|---|
| private FontGroup() | |
| valueOf | back to summary |
|---|---|
| public static PdfBoxFontResolver. | |
| values | back to summary |
|---|---|
| public static PdfBoxFontResolver. | |