Klasse PdfBoxGraphics2DFontTextDrawerDefaultFonts

java.lang.Object
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawerDefaultFonts
Alle implementierten Schnittstellen:
IPdfBoxGraphics2DFontTextDrawer, Closeable, AutoCloseable
Bekannte direkte Unterklassen:
PdfBoxGraphics2DFontTextForcedDrawer

public class PdfBoxGraphics2DFontTextDrawerDefaultFonts extends PdfBoxGraphics2DFontTextDrawer
Like 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.
  • Konstruktordetails

    • PdfBoxGraphics2DFontTextDrawerDefaultFonts

      public PdfBoxGraphics2DFontTextDrawerDefaultFonts()
  • Methodendetails

    • mapFont

      protected org.apache.pdfbox.pdmodel.font.PDFont mapFont(Font font, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws IOException, FontFormatException
      Beschreibung aus Klasse kopiert: PdfBoxGraphics2DFontTextDrawer
      Try to map the java.awt.Font to a PDFont.
      Setzt außer Kraft:
      mapFont in Klasse PdfBoxGraphics2DFontTextDrawer
      Parameter:
      font - the java.awt.Font for which a mapping should be found
      env - environment of the font mapper
      Gibt zurück:
      the PDFont or null if none can be found.
      Löst aus:
      IOException - when the font can not be loaded
      FontFormatException - when the font file can not be loaded
    • mapDefaultFonts

      public static org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName mapDefaultFonts(Font font)
      Find a PDFont for the given font object, which does not need to be embedded.
      Parameter:
      font - font for which to find a suitable default font
      Gibt zurück:
      null if no default font is found or a default font which does not need to be embedded.
    • chooseMatchingTimes

      public static org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName chooseMatchingTimes(Font font)
      Get a PDType1Font.TIMES-variant, which matches the given font
      Parameter:
      font - Font to get the styles from
      Gibt zurück:
      a PDFont Times variant which matches the style in the given Font object.
    • chooseMatchingCourier

      public static org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName chooseMatchingCourier(Font font)
      Get a PDType1Font.COURIER-variant, which matches the given font
      Parameter:
      font - Font to get the styles from
      Gibt zurück:
      a PDFont Courier variant which matches the style in the given Font object.
    • chooseMatchingHelvetica

      public static org.apache.pdfbox.pdmodel.font.Standard14Fonts.FontName chooseMatchingHelvetica(Font font)
      Get a PDType1Font.HELVETICA-variant, which matches the given font
      Parameter:
      font - Font to get the styles from
      Gibt zurück:
      a PDFont Helvetica variant which matches the style in the given Font object.