Class PostScriptDocument


  • public class PostScriptDocument
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void boundingBox​(int w, int h)  
      void close()  
      int getFontSize()  
      double getLineHeight()  
      java.lang.String getPS()  
      double getWidth​(char c)
      All chars are 600 thousands of an 'em' wide if courier
      double getWidth​(java.lang.String s)  
      protected java.lang.StringBuilder header()
      Compute the header separately because we need to wait for the bounding box
      void highlight​(double x, double y, double width, double height)
      Make red box
      void line​(double x1, double y1, double x2, double y2)  
      void lineto​(double x, double y)  
      void lineWidth​(double w)  
      void move​(double x, double y)  
      void rect​(double x, double y, double width, double height)  
      void setFont​(java.lang.String fontName, int fontSize)  
      void stroke()  
      void text​(java.lang.String s, double x, double y)  
      • Methods inherited from class java.lang.Object

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

      • POSTSCRIPT_FONT_NAMES

        public static final java.util.Map<java.lang.String,​java.lang.String> POSTSCRIPT_FONT_NAMES
      • boundingBoxWidth

        protected int boundingBoxWidth
      • boundingBoxHeight

        protected int boundingBoxHeight
      • fontName

        protected java.lang.String fontName
      • fontSize

        protected int fontSize
      • lineWidth

        protected double lineWidth
      • boundingBox

        protected java.lang.String boundingBox
      • ps

        protected java.lang.StringBuilder ps
      • closed

        protected boolean closed
    • Constructor Detail

      • PostScriptDocument

        public PostScriptDocument()
      • PostScriptDocument

        public PostScriptDocument​(java.lang.String fontName,
                                  int fontSize)
    • Method Detail

      • getPS

        public java.lang.String getPS()
      • boundingBox

        public void boundingBox​(int w,
                                int h)
      • close

        public void close()
      • header

        protected java.lang.StringBuilder header()
        Compute the header separately because we need to wait for the bounding box
      • setFont

        public void setFont​(java.lang.String fontName,
                            int fontSize)
      • lineWidth

        public void lineWidth​(double w)
      • move

        public void move​(double x,
                         double y)
      • lineto

        public void lineto​(double x,
                           double y)
      • line

        public void line​(double x1,
                         double y1,
                         double x2,
                         double y2)
      • rect

        public void rect​(double x,
                         double y,
                         double width,
                         double height)
      • highlight

        public void highlight​(double x,
                              double y,
                              double width,
                              double height)
        Make red box
      • stroke

        public void stroke()
      • text

        public void text​(java.lang.String s,
                         double x,
                         double y)
      • getWidth

        public double getWidth​(char c)
        All chars are 600 thousands of an 'em' wide if courier
      • getWidth

        public double getWidth​(java.lang.String s)
      • getLineHeight

        public double getLineHeight()
      • getFontSize

        public int getFontSize()