Compute the header separately because we need to wait for the bounding box
()
| 73 | |
| 74 | /** Compute the header separately because we need to wait for the bounding box */ |
| 75 | protected StringBuilder header() { |
| 76 | StringBuilder b = new StringBuilder(); |
| 77 | b.append("%!PS-Adobe-3.0 EPSF-3.0\n"); |
| 78 | b.append(boundingBox).append("\n"); |
| 79 | b.append("0.3 setlinewidth\n"); |
| 80 | b.append("%% x y w h highlight\n" + |
| 81 | "/highlight {\n" + |
| 82 | " 4 dict begin\n" + |
| 83 | " /h exch def\n" + |
| 84 | " /w exch def\n" + |
| 85 | " /y exch def\n" + |
| 86 | " /x exch def\n" + |
| 87 | " gsave\n" + |
| 88 | " newpath\n" + |
| 89 | " x y moveto\n" + |
| 90 | " 0 h rlineto % up to left corner\n" + |
| 91 | " w 0 rlineto % to upper right corner\n" + |
| 92 | " 0 h neg rlineto % to lower right corner\n" + |
| 93 | " w neg 0 rlineto % back home to lower left corner\n" + |
| 94 | " closepath\n" + |
| 95 | " .95 .83 .82 setrgbcolor\n" + |
| 96 | " fill\n" + |
| 97 | " grestore\n" + |
| 98 | " end\n" + |
| 99 | "} def\n"); |
| 100 | |
| 101 | return b; |
| 102 | } |
| 103 | |
| 104 | public void setFont(String fontName, int fontSize) { |
| 105 | this.fontMetrics = new SystemFontMetrics(fontName); |
no test coverage detected