IPdfBoxGraphics2DFontTextDrawer
, Closeable
, AutoCloseable
PdfBoxGraphics2DFontTextForcedDrawer
public class PdfBoxGraphics2DFontTextDrawerDefaultFonts extends PdfBoxGraphics2DFontTextDrawer
PdfBoxGraphics2DFontTextDrawer
, but tries to use default fonts
whenever possible. Default fonts are not embedded. You can register
additional font files. If no font mapping is found, Helvetica is used.
This will fallback to vectorized text if any kind of RTL text is rendered
and/or any other not supported feature is used.IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv
Constructor | Description |
---|---|
PdfBoxGraphics2DFontTextDrawerDefaultFonts() |
Modifier and Type | Method | Description |
---|---|---|
static org.apache.pdfbox.pdmodel.font.PDFont |
chooseMatchingCourier(Font font) |
Get a PDType1Font.COURIER-variant, which matches the given font
|
static org.apache.pdfbox.pdmodel.font.PDFont |
chooseMatchingHelvetica(Font font) |
Get a PDType1Font.HELVETICA-variant, which matches the given font
|
static org.apache.pdfbox.pdmodel.font.PDFont |
chooseMatchingTimes(Font font) |
Get a PDType1Font.TIMES-variant, which matches the given font
|
static org.apache.pdfbox.pdmodel.font.PDFont |
mapDefaultFonts(Font font) |
Find a PDFont for the given font object, which does not need to be embedded.
|
protected org.apache.pdfbox.pdmodel.font.PDFont |
mapFont(Font font,
IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) |
Try to map the java.awt.Font to a PDFont.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDrawText, close, drawText, hasDynamicFontMapping, registerFont, registerFont, registerFont, registerFont, registerFont
public PdfBoxGraphics2DFontTextDrawerDefaultFonts()
protected org.apache.pdfbox.pdmodel.font.PDFont mapFont(Font font, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws IOException, FontFormatException
PdfBoxGraphics2DFontTextDrawer
mapFont
in class PdfBoxGraphics2DFontTextDrawer
font
- the java.awt.Font for which a mapping should be foundenv
- environment of the font mapperIOException
FontFormatException
public static org.apache.pdfbox.pdmodel.font.PDFont mapDefaultFonts(Font font)
font
- font for which to find a suitable default fontpublic static org.apache.pdfbox.pdmodel.font.PDFont chooseMatchingTimes(Font font)
font
- Font to get the styles frompublic static org.apache.pdfbox.pdmodel.font.PDFont chooseMatchingCourier(Font font)
font
- Font to get the styles frompublic static org.apache.pdfbox.pdmodel.font.PDFont chooseMatchingHelvetica(Font font)
font
- Font to get the styles fromCopyright © 2017. All rights reserved.