|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFFont
org.faceless.pdf2.StandardFont
public final class StandardFont
A concrete subclass of PDFFont
representing the standard 14 fonts
guaranteed to exist in all PDF readers.
The Times, Helvetica and Courier fonts can represent the characters from all of ISO-8859-1, ISO-8859-2, ISO-8859-6 and ISO-8859-15 as well as a few other characters, which we believe is enough to render the following languages: English, French, German, Portuguese, Italian, Spanish, Dutch, Danish, Swedish, Norwegian, Icelandic, Finnish, Polish, Croatian, Czech, Hungarian, Romanian, Slovak, Solvenian, Latvian, Lithuanian, Estonian, Turkish, Catalan, Basque, Albanian, Rhaeto-Romanic, Sorbian, Faroese, Irish, Scottish, Afrikaans, Swahili, Frisian, Galician, Indonesian/Malay and Tagalog. (This list is based on an old IETF draft here and Roman Czyborras Alphabet Soup pages, and is not definitive or even necessarily accurate). Note the Dutch IJ ligatures (U+0132 and U+0133) and the Catalan "L with dot" (U+0140) characters are missing.
Maps showing all the characters available in these fonts are included in the "docs" directory, or you can view them here for the main fonts, the Symbol font and ZapfDingbats.
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 fonttype)
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. |
String |
getBaseName()
Return the Base Font Name for this font. |
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. |
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. |
float |
getXHeight()
Get the X-Height of the font - normally the height of a lower-case 'x' character |
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) |
String |
toString()
|
PDFFont |
versionBold()
Return a bold version of the current font, if available. |
PDFFont |
versionItalic()
Return an italic version of the current font, if available. |
PDFFont |
versionNonBold()
Return a non-bold version of the current font, if available. |
PDFFont |
versionNonItalic()
Return a non-italic version of the current font, if available. |
PDFFont |
versionRegular()
Return a non-bold, non-italic version of the current font, if available. |
Methods inherited from class org.faceless.pdf2.PDFFont |
---|
getAvailableFeatures, getBottom, getCharWidth, getCharWidth, getFeature, getKerning, getKerning, getLeft, getRight, getTop, isDefined, isDefined, isHorizontal, ligaturize, ligaturize, requote, requote, setFeature |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, 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 fonttype)
fonttype
- which font to create - one of TIMES
, COURIERBOLD
etc.Method Detail |
---|
public String getBaseName()
PDFFont
getBaseName
in class PDFFont
public 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 float getXHeight()
PDFFont
getXHeight
in class PDFFont
public boolean isMonospace()
PDFFont
isMonospace
in class PDFFont
public PDFFont versionItalic()
PDFFont
versionItalic
in class PDFFont
public PDFFont versionBold()
PDFFont
versionBold
in class PDFFont
public PDFFont versionNonItalic()
PDFFont
versionNonItalic
in class PDFFont
public PDFFont versionNonBold()
PDFFont
versionNonBold
in class PDFFont
public PDFFont versionRegular()
PDFFont
versionRegular
in class PDFFont
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |