Class Type3Font

java.lang.Object
com.itextpdf.io.font.FontProgram
com.itextpdf.kernel.font.Type3Font

public class Type3Font extends FontProgram
FontProgram class for Type 3 font. Contains map of Type3Glyph. Type3Glyphs belong to a particular pdf document. Note, an instance of Type3Font can not be reused for multiple pdf documents.
  • Method Details

    • getType3Glyph

      public Type3Glyph getType3Glyph (int unicode)
      Returns a glyph by unicode.
      Parameters:
      unicode - glyph unicode
      Returns:
      Type3Glyph glyph, or null if this font does not contain glyph for the unicode
    • getType3GlyphByCode

      public Type3Glyph getType3GlyphByCode (int code)
      Returns a glyph by its code. These glyphs may not have unicode.
      Parameters:
      code - glyph code
      Returns:
      Type3Glyph glyph, or null if this font does not contain glyph for the code
    • getPdfFontFlags

      public int getPdfFontFlags()
      Description copied from class: FontProgram
      Computes the PDF font descriptor flags for this program.
      Specified by:
      getPdfFontFlags in class FontProgram
      Returns:
      bit set defined by the PDF font descriptor specification
    • isFontSpecific

      public boolean isFontSpecific()
      Description copied from class: FontProgram
      Checks whether this program uses its built-in character encoding.
      Overrides:
      isFontSpecific in class FontProgram
      Returns:
      true when character codes are font-specific
    • isColorized

      public boolean isColorized()
    • getKerning

      public int getKerning (Glyph glyph1, Glyph glyph2)
      Description copied from class: FontProgram
      Gets the kerning between two glyphs.
      Specified by:
      getKerning in class FontProgram
      Parameters:
      glyph1 - the first glyph
      glyph2 - the second glyph
      Returns:
      the kerning to be applied
    • getNumberOfGlyphs

      public int getNumberOfGlyphs()
      Returns number of glyphs for this font. Counts glyphs independent on whether the glyph has unicode mapping or not.
      Returns:
      int number off all glyphs
    • setFontName

      protected void setFontName (String fontName)
      Sets the PostScript name of the font.

      If full name is null, it will be set as well.

      Overrides:
      setFontName in class FontProgram
      Parameters:
      fontName - the PostScript name of the font, shall not be null or empty.
    • setFontFamily

      protected void setFontFamily (String fontFamily)
      Sets a preferred font family name.
      Overrides:
      setFontFamily in class FontProgram
      Parameters:
      fontFamily - a preferred font family name.
    • setFontWeight

      protected void setFontWeight (int fontWeight)
      Sets font weight.
      Overrides:
      setFontWeight in class FontProgram
      Parameters:
      fontWeight - integer form 100 to 900. See FontWeights.
    • setFontStretch

      protected void setFontStretch (String fontWidth)
      Sets font width in css notation (font-stretch property)
      Overrides:
      setFontStretch in class FontProgram
      Parameters:
      fontWidth - FontStretches.
    • setCapHeight

      protected void setCapHeight (int capHeight)
      Sets the capital letters height. See also FontMetrics.setCapHeight(int).
      Overrides:
      setCapHeight in class FontProgram
      Parameters:
      capHeight - cap height in 1000-units
    • setItalicAngle

      protected void setItalicAngle (int italicAngle)
      Sets the PostScript italic angle.

      Italic angle in counterclockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

      Overrides:
      setItalicAngle in class FontProgram
      Parameters:
      italicAngle - in counterclockwise degrees from the vertical
    • setTypoAscender

      protected void setTypoAscender (int ascender)
      Sets typo ascender. See also FontMetrics.setTypoAscender(int).
      Overrides:
      setTypoAscender in class FontProgram
      Parameters:
      ascender - typo ascender value in 1000-units
    • setTypoDescender

      protected void setTypoDescender (int descender)
      Sets typo descender. See also FontMetrics.setTypoDescender(int).
      Overrides:
      setTypoDescender in class FontProgram
      Parameters:
      descender - typo descender value in 1000-units