Class Type1CharString

  • Direct Known Subclasses:
    Type2CharString

    public class Type1CharString
    extends java.lang.Object
    This class represents and renders a Type 1 CharString.
    Author:
    Villu Ruusmann, John Hewson
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Type1CharString​(Type1CharStringReader font, java.lang.String fontName, java.lang.String glyphName)
      Constructor for use in subclasses.
        Type1CharString​(Type1CharStringReader font, java.lang.String fontName, java.lang.String glyphName, java.util.List<java.lang.Object> sequence)
      Constructs a new Type1CharString object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addCommand​(java.util.List<java.lang.Number> numbers, CharStringCommand command)
      Add a command to the type1 sequence.
      java.awt.geom.Rectangle2D getBounds()
      Returns the bounds of the renderer path.
      protected java.lang.Object getLastSequenceEntry()
      Returns the last entry of the underlying type1 sequence.
      java.lang.String getName()  
      java.awt.geom.GeneralPath getPath()
      Returns the path of the character.
      int getWidth()
      Returns the advance width of the glyph.
      protected boolean isSequenceEmpty()
      Indicates if the underlying type1 sequence is empty.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Type1CharString

        public Type1CharString​(Type1CharStringReader font,
                               java.lang.String fontName,
                               java.lang.String glyphName,
                               java.util.List<java.lang.Object> sequence)
        Constructs a new Type1CharString object.
        Parameters:
        font - Parent Type 1 CharString font.
        fontName - Name of the font.
        glyphName - Name of the glyph.
        sequence - Type 1 char string sequence
      • Type1CharString

        protected Type1CharString​(Type1CharStringReader font,
                                  java.lang.String fontName,
                                  java.lang.String glyphName)
        Constructor for use in subclasses.
        Parameters:
        font - Parent Type 1 CharString font.
        fontName - Name of the font.
        glyphName - Name of the glyph.
    • Method Detail

      • getName

        public java.lang.String getName()
      • getBounds

        public java.awt.geom.Rectangle2D getBounds()
        Returns the bounds of the renderer path.
        Returns:
        the bounds as Rectangle2D
      • getWidth

        public int getWidth()
        Returns the advance width of the glyph.
        Returns:
        the width
      • getPath

        public java.awt.geom.GeneralPath getPath()
        Returns the path of the character.
        Returns:
        the path
      • addCommand

        protected void addCommand​(java.util.List<java.lang.Number> numbers,
                                  CharStringCommand command)
        Add a command to the type1 sequence.
        Parameters:
        numbers - the parameters of the command to be added
        command - the command to be added
      • isSequenceEmpty

        protected boolean isSequenceEmpty()
        Indicates if the underlying type1 sequence is empty.
        Returns:
        true if the sequence is empty
      • getLastSequenceEntry

        protected java.lang.Object getLastSequenceEntry()
        Returns the last entry of the underlying type1 sequence.
        Returns:
        the last entry of the type 1 sequence or null if empty
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object