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
      private static int CALLOTHERSUBR  
      private static int CALLSUBR  
      private java.lang.String currentGlyph  
      private java.lang.String fontName  
      private static org.apache.commons.logging.Log LOG  
      private static int POP  
      private static int TWO_BYTE  
    • Constructor Summary

      Constructors 
      Constructor Description
      Type1CharStringParser​(java.lang.String fontName)
      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, java.lang.String glyphName)
      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 void processCallOtherSubr​(DataInput input, java.util.List<java.lang.Object> sequence)  
      private void processCallSubr​(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
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
      • fontName

        private final java.lang.String fontName
      • currentGlyph

        private java.lang.String currentGlyph
    • Constructor Detail

      • Type1CharStringParser

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

      • parse

        public java.util.List<java.lang.Object> parse​(byte[] bytes,
                                                      java.util.List<byte[]> subrs,
                                                      java.lang.String glyphName)
                                               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
        glyphName - name of the current glyph
        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
      • processCallSubr

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

        private void processCallOtherSubr​(DataInput input,
                                          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