public class PostScriptDocument
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
boundingBox |
protected int |
boundingBoxHeight |
protected int |
boundingBoxWidth |
protected boolean |
closed |
static java.lang.String |
DEFAULT_FONT |
protected SystemFontMetrics |
fontMetrics |
protected java.lang.String |
fontName |
protected int |
fontSize |
protected double |
lineWidth |
static java.util.Map<java.lang.String,java.lang.String> |
POSTSCRIPT_FONT_NAMES |
protected java.lang.StringBuilder |
ps |
Constructor and Description |
---|
PostScriptDocument() |
PostScriptDocument(java.lang.String fontName,
int fontSize) |
Modifier and Type | Method and 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) |
public static final java.lang.String DEFAULT_FONT
public static final java.util.Map<java.lang.String,java.lang.String> POSTSCRIPT_FONT_NAMES
protected int boundingBoxWidth
protected int boundingBoxHeight
protected SystemFontMetrics fontMetrics
protected java.lang.String fontName
protected int fontSize
protected double lineWidth
protected java.lang.String boundingBox
protected java.lang.StringBuilder ps
protected boolean closed
public PostScriptDocument()
public PostScriptDocument(java.lang.String fontName, int fontSize)
public java.lang.String getPS()
public void boundingBox(int w, int h)
public void close()
protected java.lang.StringBuilder header()
public void setFont(java.lang.String fontName, int fontSize)
public void lineWidth(double w)
public void move(double x, double y)
public void lineto(double x, double y)
public void line(double x1, double y1, double x2, double y2)
public void rect(double x, double y, double width, double height)
public void highlight(double x, double y, double width, double height)
public void stroke()
public void text(java.lang.String s, double x, double y)
public double getWidth(char c)
public double getWidth(java.lang.String s)
public double getLineHeight()
public int getFontSize()