Class Type1Font

java.lang.Object
com.itextpdf.io.font.FontProgram
com.itextpdf.io.font.Type1Font

public class Type1Font extends FontProgram
  • Constructor Details

    • Type1Font

      protected Type1Font()
    • Type1Font

      protected Type1Font (String metricsPath, String binaryPath, byte[] afm, byte[] pfb) throws IOException
      Throws:
      IOException
    • Type1Font

      protected Type1Font (String baseFont)
  • Method Details

    • createStandardFont

      protected static Type1Font createStandardFont (String name) throws IOException
      Throws:
      IOException
    • initializeGlyphs

      public void initializeGlyphs (FontEncoding fontEncoding)
      Fills missing character codes in codeToGlyph map.
      Parameters:
      fontEncoding - to be used to map unicode values to character codes.
    • isBuiltInFont

      public boolean isBuiltInFont()
    • getPdfFontFlags

      public int getPdfFontFlags()
      Specified by:
      getPdfFontFlags in class FontProgram
    • getCharacterSet

      public String getCharacterSet()
    • hasKernPairs

      public boolean hasKernPairs()
      Checks if the font has any kerning pairs.
      Overrides:
      hasKernPairs in class FontProgram
      Returns:
      true if the font has any kerning pairs.
    • getKerning

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

      public boolean setKerning (int first, int second, int kern)
      Sets the kerning between two Unicode chars.
      Parameters:
      first - the first unicode char.
      second - the second unicode char.
      kern - the kerning to apply in normalized 1000 units.
      Returns:
      true if the kerning was applied, false otherwise.
    • getGlyph

      public Glyph getGlyph (String name)
      Find glyph by glyph name.
      Parameters:
      name - Glyph name
      Returns:
      Glyph instance if found, otherwise null.
    • getFontStreamBytes

      public byte[] getFontStreamBytes()
    • getFontStreamLengths

      public int[] getFontStreamLengths()
    • isBuiltWith

      public boolean isBuiltWith (String fontProgram)
      Description copied from class: FontProgram
      Checks whether the FontProgram was built with corresponding fontName. Default value is false unless overridden.
      Overrides:
      isBuiltWith in class FontProgram
      Parameters:
      fontProgram - a font name or path to a font program
      Returns:
      true, if the FontProgram was built with the fontProgram. Otherwise false.
    • process

      protected void process() throws IOException
      Throws:
      IOException