Class Type1Lexer

java.lang.Object
org.apache.fontbox.type1.Type1Lexer

class Type1Lexer extends Object
Lexer for the ASCII portions of an Adobe Type 1 font.
See Also:
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
      Log instance.
    • buffer

      private final ByteBuffer buffer
    • aheadToken

      private Token aheadToken
    • openParens

      private int openParens
  • Constructor Details

    • Type1Lexer

      Type1Lexer(byte[] bytes) throws IOException
      Constructs a new Type1Lexer given a header-less .pfb segment.
      Parameters:
      bytes - Header-less .pfb segment
      Throws:
      IOException
  • Method Details

    • nextToken

      public Token nextToken() throws IOException
      Returns the next token and consumes it.
      Returns:
      The next token.
      Throws:
      IOException
    • peekToken

      public Token peekToken()
      Returns the next token without consuming it.
      Returns:
      The next token
    • getChar

      private char getChar()
      Reads an ASCII char from the buffer.
    • readToken

      private Token readToken(Token prevToken) throws IOException
      Reads a single token.
      Parameters:
      prevToken - the previous token
      Throws:
      IOException
    • tryReadNumber

      private Token tryReadNumber()
      Reads a number or returns null.
    • readRegular

      private String readRegular()
      Reads a sequence of regular characters, i.e. not delimiters or whitespace
    • readComment

      private String readComment()
      Reads a line comment.
    • readString

      private Token readString() throws IOException
      Reads a (string).
      Throws:
      IOException
    • readCharString

      private Token readCharString(int length)
      Reads a binary CharString.