Class Type1CharStringParser


  • public class Type1CharStringParser
    extends java.lang.Object
    This class represents a converter for a mapping into a Type 1 sequence.
    See Also:
    "Adobe Type 1 Font Format, Adobe Systems (1999)"
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int CALLOTHERSUBR  
      (package private) static int CALLSUBR  
      private java.lang.String fontName  
      private java.lang.String glyphName  
      private static org.apache.commons.logging.Log LOG  
      (package private) static int POP  
      (package private) static int RETURN  
      (package private) static int TWO_BYTE  
    • Constructor Summary

      Constructors 
      Constructor Description
      Type1CharStringParser​(java.lang.String fontName, java.lang.String glyphName)
      Constructs a new Type1CharStringParser object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Object> parse​(byte[] bytes, java.util.List<byte[]> subrs)
      The given byte array will be parsed and converted to a Type1 sequence.
      private java.util.List<java.lang.Object> parse​(byte[] bytes, java.util.List<byte[]> subrs, java.util.List<java.lang.Object> sequence)  
      private CharStringCommand readCommand​(DataInput input, int b0)  
      private java.lang.Integer readNumber​(DataInput input, int b0)  
      private static java.lang.Integer removeInteger​(java.util.List<java.lang.Object> sequence)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Type1CharStringParser

        public Type1CharStringParser​(java.lang.String fontName,
                                     java.lang.String glyphName)
        Constructs a new Type1CharStringParser object.
        Parameters:
        fontName - font name
        glyphName - glyph name
    • Method Detail

      • parse

        public java.util.List<java.lang.Object> parse​(byte[] bytes,
                                                      java.util.List<byte[]> subrs)
                                               throws java.io.IOException
        The given byte array will be parsed and converted to a Type1 sequence.
        Parameters:
        bytes - the given mapping as byte array
        subrs - list of local subroutines
        Returns:
        the Type1 sequence
        Throws:
        java.io.IOException - if an error occurs during reading
      • parse

        private java.util.List<java.lang.Object> parse​(byte[] bytes,
                                                       java.util.List<byte[]> subrs,
                                                       java.util.List<java.lang.Object> sequence)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • removeInteger

        private static java.lang.Integer removeInteger​(java.util.List<java.lang.Object> sequence)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readCommand

        private CharStringCommand readCommand​(DataInput input,
                                              int b0)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readNumber

        private java.lang.Integer readNumber​(DataInput input,
                                             int b0)
                                      throws java.io.IOException
        Throws:
        java.io.IOException