Class Type3CharProcParser

All Implemented Interfaces:
Closeable, AutoCloseable

public class Type3CharProcParser extends NotSeekableBaseParser
Parses type 3 char procs to obtain glyph widths.
Author:
Sergey Shemyakov
  • Constructor Details

  • Method Details

    • parse

      public void parse() throws IOException
      Parses width from given char proc string.
      Throws:
      IOException - if stream reading error occurred or input stream can't be parsed.
    • getWidth

      public double getWidth()
      Returns:
      width of glyph presented by given char proc or -1 if parsing failed or was not performed.
    • getAscent

      @Deprecated public double getAscent()
      Deprecated.
      a char proc that begins with the d0 operator specifies the glyph width only (ISO 32000-1, 9.6.5.3) and declares no glyph bounding box, so its ascent is undefined rather than 0. This method cannot express that; use getAscentOrNull() instead.
      Returns:
      ascent of the glyph presented by given char proc, or 0 if the char proc declares no glyph bounding box.
    • getDescent

      @Deprecated public double getDescent()
      Deprecated.
      undefined descent cannot be distinguished from 0; use getDescentOrNull() instead. See getAscent().
      Returns:
      descent of the glyph presented by given char proc, or 0 if the char proc declares no glyph bounding box.
    • getAscentOrNull

      public Double getAscentOrNull()
      Returns:
      ascent of the glyph presented by given char proc, or null if the char proc declares no glyph bounding box. A char proc that begins with the d0 operator specifies the glyph width only (ISO 32000-1, 9.6.5.3), so its ascent is undefined rather than 0.
    • getDescentOrNull

      public Double getDescentOrNull()
      Returns:
      descent of the glyph presented by given char proc, or null if the char proc declares no glyph bounding box. See getAscentOrNull().