|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFObject
org.faceless.pdf2.PDFMap
org.faceless.pdf2.PDFFont
org.faceless.pdf2.StandardFont
A concrete subclass of PDFFont
representing the standard 14 fonts
guaranteed to exist in all PDF readers.
Field Summary | |
static int |
COURIER
Represents the "Courier" font |
static int |
COURIERBOLD
Represents the "Courier-Bold" font |
static int |
COURIERBOLDOBLIQUE
Represents the "Courier-BoldOblique" font |
static int |
COURIEROBLIQUE
Represents the "Courier-Oblique" font |
static int |
HELVETICA
Represents the "Helvetica" font |
static int |
HELVETICABOLD
Represents the "Helvetica-Bold" font |
static int |
HELVETICABOLDOBLIQUE
Represents the "Helvetica-BoldOblique" font |
static int |
HELVETICAOBLIQUE
Represents the "Helvetica-Oblique" font |
static int |
SYMBOL
Represents the "Symbol" font |
static int |
TIMES
Represents the "Times-Roman" font |
static int |
TIMESBOLD
Represents the "Times-Bold" font |
static int |
TIMESBOLDITALIC
Represents the "Times-BoldItalic" font |
static int |
TIMESITALIC
Represents the "Times-Italic" font |
static int |
ZAPFDINGBATS
Represents the "ZapfDingbats" font. |
Constructor Summary | |
StandardFont(int type)
Create a new font of the specified type. |
Method Summary | |
float |
getAscender()
Get the Ascender for the font (the maximum height above the baseline the font extends), as a proportion of the point size. |
float |
getDefaultLeading()
Get the default leading for this font - the preferred distance between two successive baselines of text. |
float |
getDescender()
Get the Descender for the font (the maximum height below the baseline the font extends), as a proportion of the point size. |
int |
getKerning(int i1,
int i2)
Get the horizontal character-to-character (or "pair-wise") kerning in this font for the specified characters, in millipoints. |
float |
getStrikeoutPosition()
Get the strikeout position, as a proportion of the font size. |
float |
getStrikeoutThickness()
Get the strikeout thickness, as a proportion of the font size. |
float |
getSubscriptPosition()
Get the recommended position of a sub-script version of this font, as a proportion of the sub-scripted font size. |
float |
getSubscriptSize()
Get the recommended size of a super/sub script version of this font, as a proportion of the normal font size. |
float |
getSuperscriptPosition()
Get the recommended position of a super-script version of this font, as a proportion of the sub-scripted font size. |
float |
getUnderlinePosition()
Get the underline position, as a proportion of the font size. |
float |
getUnderlineThickness()
Get the underline thickness, as a proportion of the font size. |
int |
hashCode()
|
boolean |
isMonospace()
Return true if every character has the same width (like Courier), false if every character is potentially a different width (like Times-Roman) |
PDFFont |
versionBold()
Return a bold version of this font if it exists, or the current font if it doesn't. |
PDFFont |
versionItalic()
Return an italic version of this font if it exists, or the current font if it doesn't. |
PDFFont |
versionRegular()
Return a regular (non-bold, non-italic) version of this font if it exists, or the current font if it doesn't. |
Methods inherited from class org.faceless.pdf2.PDFFont |
equals, getBaseName, getBottom, getCharWidth, getCharWidth, getKerning, getLeft, getRight, getTop, isDefined, isDefined, isHorizontal, ligaturize, ligaturize, requote, requote, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TIMES
public static final int TIMESBOLD
public static final int TIMESITALIC
public static final int TIMESBOLDITALIC
public static final int HELVETICA
public static final int HELVETICABOLD
public static final int HELVETICAOBLIQUE
public static final int HELVETICABOLDOBLIQUE
public static final int COURIER
public static final int COURIERBOLD
public static final int COURIEROBLIQUE
public static final int COURIERBOLDOBLIQUE
public static final int SYMBOL
public static final int ZAPFDINGBATS
docs/map-zapf.pdf
that
came with the distribution to see what these codepoints are.
Constructor Detail |
public StandardFont(int type)
type
- Which font to create. One of TIMES
, COURIERBOLD
etc.Method Detail |
public int getKerning(int i1, int i2)
PDFFont
PDFFont.getKerning(char,char)
but takes ints, to handle the new Unicode 4.0
characters defined in Java 1.5
getKerning
in class PDFFont
i1
- a Unicode codepoint between U+0000 and U+10FFFDi2
- a Unicode codepoint between U+0000 and U+10FFFDpublic float getDefaultLeading()
PDFFont
Get the default leading for this font - the preferred distance between two successive baselines of text. Values are a ratio of the font size, and are typically between 1 and 1.3
Note that the values of the different spacing-between-lines methods have
changed - in versions 1.0.4 and earlier this routine normally returned 1
and the spacing was set by the PDFStyle.setTextLineSpacing(float)
method.
Since 1.1, the values for these two methods are effectively reversed. See
the relevant method comments in the PDFStyle
class for more
information.
getDefaultLeading
in class PDFFont
public float getStrikeoutThickness()
PDFFont
getStrikeoutThickness
in class PDFFont
public float getStrikeoutPosition()
PDFFont
getStrikeoutPosition
in class PDFFont
public float getSubscriptSize()
PDFFont
Get the recommended size of a super/sub script version of this font, as a proportion of the normal font size. Typical value is around 0.6.
For some fonts (like CJK or barcode fonts) where there is no concept of super or subscript, this value is entirely arbitrary.
getSubscriptSize
in class PDFFont
public float getSuperscriptPosition()
PDFFont
Get the recommended position of a super-script version of this font, as a proportion of the sub-scripted font size. Value is always positive.
For some fonts (like CJK or barcode fonts) where there is no concept of super or subscript, this value is entirely arbitrary.
getSuperscriptPosition
in class PDFFont
public float getSubscriptPosition()
PDFFont
Get the recommended position of a sub-script version of this font, as a proportion of the sub-scripted font size. Value is almost always zero or negative.
For some fonts (like CJK or barcode fonts) where there is no concept of super or subscript, this value is entirely arbitrary.
getSubscriptPosition
in class PDFFont
public float getUnderlineThickness()
PDFFont
getUnderlineThickness
in class PDFFont
public float getUnderlinePosition()
PDFFont
getDescender()
method, the returned value is almost
always negative, indicating below the baseline.
getUnderlinePosition
in class PDFFont
public float getAscender()
PDFFont
getAscender
in class PDFFont
public float getDescender()
PDFFont
getDescender
in class PDFFont
public boolean isMonospace()
PDFFont
isMonospace
in class PDFFont
public PDFFont versionItalic()
public PDFFont versionBold()
public PDFFont versionRegular()
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |