public static class PdfBoxFontResolver.FontDescription extends Object implements MinimalFontDescription
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.| Constructor and Description |
|---|
FontDescription(org.apache.pdfbox.pdmodel.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.
|
FontDescription(org.apache.pdfbox.pdmodel.PDDocument doc,
FSSupplier<org.apache.pdfbox.pdmodel.font.PDFont> fontSupplier,
IdentValue style,
int weight,
String family,
boolean isFromFontFace,
boolean isSubset,
FSCacheEx<String,FSCacheValue> metricsCache)
Creates a font description from a PDFont supplier.
|
FontDescription(org.apache.pdfbox.pdmodel.font.PDFont font,
IdentValue style,
int weight)
Create a font description from one of the PDF built-in fonts.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getFamily() |
org.apache.pdfbox.pdmodel.font.PDFont |
getFont()
Downloads and parses the font if required.
|
PdfBoxRawPDFontMetrics |
getFontMetrics()
Downloads and parses the font if required (metrics were not available from cache).
|
IdentValue |
getStyle() |
int |
getWeight() |
boolean |
isFontAvailable()
Returns whether the font is available yet.
|
boolean |
isFromFontFace() |
boolean |
isMetricsAvailable()
If the metrics are available yet.
|
boolean |
realizeFont() |
String |
toString() |
public FontDescription(org.apache.pdfbox.pdmodel.font.PDFont font,
IdentValue style,
int weight)
public FontDescription(org.apache.pdfbox.pdmodel.PDDocument doc,
FSSupplier<InputStream> supplier,
int weight,
IdentValue style,
String family,
boolean isFromFontFace,
boolean isSubset,
FSCacheEx<String,FSCacheValue> metricsCache)
getFont() or
getFontMetrics() (and the font metrics were not available from cache) are called.public FontDescription(org.apache.pdfbox.pdmodel.PDDocument doc,
FSSupplier<org.apache.pdfbox.pdmodel.font.PDFont> fontSupplier,
IdentValue style,
int weight,
String family,
boolean isFromFontFace,
boolean isSubset,
FSCacheEx<String,FSCacheValue> metricsCache)
getFont() or getFontMetrics() (and the font metrics were not available from cache) are called.public String getFamily()
public boolean realizeFont()
public boolean isFontAvailable()
getFont()public org.apache.pdfbox.pdmodel.font.PDFont getFont()
public int getWeight()
getWeight in interface MinimalFontDescriptionpublic IdentValue getStyle()
getStyle in interface MinimalFontDescriptionpublic boolean isFromFontFace()
public boolean isMetricsAvailable()
getFontMetrics()public PdfBoxRawPDFontMetrics getFontMetrics()
isMetricsAvailable()Copyright © 2004–2025. All rights reserved.