Class Type3Glyph

java.lang.Object
com.itextpdf.kernel.pdf.canvas.PdfCanvas
com.itextpdf.kernel.font.Type3Glyph

public final class Type3Glyph extends PdfCanvas
The content where Type3 glyphs are written to.
  • Field Details

    • D_0_STR

      private static final String D_0_STR
      See Also:
    • D_1_STR

      private static final String D_1_STR
      See Also:
    • d0

      private static final byte[] d0
    • d1

      private static final byte[] d1
    • wx

      private float wx
    • llx

      private float llx
    • lly

      private float lly
    • urx

      private float urx
    • ury

      private float ury
    • isColor

      private boolean isColor
  • Constructor Details

    • Type3Glyph

      Type3Glyph(PdfDocument pdfDocument, float wx, float llx, float lly, float urx, float ury, boolean isColor)
      Creates a Type3Glyph canvas with a new Content Stream.
      Parameters:
      pdfDocument - the document that this canvas is created for
    • Type3Glyph

      Type3Glyph(PdfStream pdfStream, PdfDocument document)
      Creates a Type3Glyph canvas with a non-empty Content Stream.
      Parameters:
      pdfStream - PdfStream from existed document.
      document - document to which PdfStream belongs.
  • Method Details

    • getWx

      public float getWx()
    • getLlx

      public float getLlx()
    • getLly

      public float getLly()
    • getUrx

      public float getUrx()
    • getUry

      public float getUry()
    • isColor

      public boolean isColor()
      Indicates if the glyph color specified in the glyph description or not.
      Returns:
      whether the glyph color is specified in the glyph description or not
    • writeMetrics

      private void writeMetrics(float wx, float llx, float lly, float urx, float ury, boolean isColor)
      Writes the width and optionally the bounding box parameters for a glyph
      Parameters:
      wx - the advance this character will have
      llx - the X lower left corner of the glyph bounding box. If the isColor option is true the value is ignored
      lly - the Y lower left corner of the glyph bounding box. If the isColor option is true the value is ignored
      urx - the X upper right corner of the glyph bounding box. If the isColor option is true the value is ignored
      ury - the Y upper right corner of the glyph bounding box. If the isColor option is true the value is ignored
      isColor - defines whether the glyph color is specified in the glyph description in the font. The consequence of value true is that the bounding box parameters are ignored.
    • addImageWithTransformationMatrix

      public PdfXObject addImageWithTransformationMatrix(ImageData image, float a, float b, float c, float d, float e, float f, boolean inlineImage)
      Creates Image XObject from image and adds it to canvas. Performs additional checks to make sure that we only add mask images to not colorized type 3 fonts.
      Overrides:
      addImageWithTransformationMatrix in class PdfCanvas
      Parameters:
      image - the PdfImageXObject object
      a - an element of the transformation matrix
      b - an element of the transformation matrix
      c - an element of the transformation matrix
      d - an element of the transformation matrix
      e - an element of the transformation matrix
      f - an element of the transformation matrix
      inlineImage - true if to add image as in-line.
      Returns:
      created Image XObject or null in case of in-line image (asInline = true).
      See Also:
    • fillBBFromBytes

      private void fillBBFromBytes(byte[] bytes)