Class PDFWArray


  • public class PDFWArray
    extends java.lang.Object
    Class representing a W array for CID fonts.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  PDFWArray.Entry
      Inner class for entries in the form "c [w ...]"
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List entries
      The metrics
    • Constructor Summary

      Constructors 
      Constructor Description
      PDFWArray()
      Default constructor
      PDFWArray​(int[] metrics)
      Convenience constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEntry​(int start, int[] metrics)
      Add an entry for single starting CID.
      void addEntry​(int first, int last, int width)
      Add an entry for a range of CIDs (/W element on p 213)
      void addEntry​(int first, int last, int width, int posX, int posY)
      Add an entry for a range of CIDs (/W2 element on p 210)
      byte[] toPDF()
      Convert this object to PDF code.
      java.lang.String toPDFString()
      Convert this object to PDF code.
      • Methods inherited from class java.lang.Object

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

      • entries

        private java.util.List entries
        The metrics
    • Constructor Detail

      • PDFWArray

        public PDFWArray()
        Default constructor
      • PDFWArray

        public PDFWArray​(int[] metrics)
        Convenience constructor
        Parameters:
        metrics - the metrics array to initially add
    • Method Detail

      • addEntry

        public void addEntry​(int start,
                             int[] metrics)
        Add an entry for single starting CID. i.e. in the form "c [w ...]"
        Parameters:
        start - the starting CID value.
        metrics - the metrics array.
      • addEntry

        public void addEntry​(int first,
                             int last,
                             int width)
        Add an entry for a range of CIDs (/W element on p 213)
        Parameters:
        first - the first CID in the range
        last - the last CID in the range
        width - the width for all CIDs in the range
      • addEntry

        public void addEntry​(int first,
                             int last,
                             int width,
                             int posX,
                             int posY)
        Add an entry for a range of CIDs (/W2 element on p 210)
        Parameters:
        first - the first CID in the range
        last - the last CID in the range
        width - the width for all CIDs in the range
        posX - the x component for the vertical position vector
        posY - the y component for the vertical position vector
      • toPDF

        public byte[] toPDF()
        Convert this object to PDF code.
        Returns:
        byte[] the PDF code
      • toPDFString

        public java.lang.String toPDFString()
        Convert this object to PDF code.
        Returns:
        String the PDF code