|
||||||||||
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.StandardCJKFont
A subclass of PDFFont representing the "standard" Chinese, Japanese and Korean fonts which are available as part of the Acrobat Reader for those countries, or as optional "language packs" for other locales. Without the language pack installed, Acrobat will throw an error message when trying to display a page containing one of these fonts. They can be can be downloaded from http://www.adobe.com/products/acrobat/acrrasianfontpack.html if they were not installed with Acrobat.
The following fonts are available:
Versions of Acrobat 5.0 used UCS2 encoding, and so was limited to displaying only characters from U+0000 to U+FFFF. Acrobat 6.0 added support for UTF16, which is required to display characters outside this range. For reasons far too complicated to go into here, UTF16 encoding is also required to display some additional characters outside this range - specifically characters added in the HKSCS-2001 and JISX0213:2004 ranges. So, to sum up:
OutputProfile
and embed a font containing the glyphs added in HKSCS-2001.OutputProfile
and embed a font containing the glyphs
added in that standard. Note that many of the character added here are in the range U+0100 to
U+0400 and U+1E00 to U+2E7F (extended latin, symbols, diacritics etc.)Although Java 1.5 is the first version to support Unicode characters above U+FFFF, you can still get by quite happily with Java 1.4 by using the appropriate surrogates from the U+D800 to U+DFFF range (which is what Java 1.5 does anyway). Since version 2.2.6 the library is aware of Unicode 4.0 characters and handles them correctly regardless of which version of Java you're running.
Field Summary | |
static int |
BOLD
A "style" parameter to the constructor requesting a bold font |
static int |
HEISEIKAKUGO
Represents the Heisei Kaku Gothic W5 font, a Japanese font with fixed width strokes |
static int |
HEISEIMIN
Represents the Heisei Mincho W3 font, a Japanese font with variable width strokes |
static int |
HYGOTHIC
Represents the HY Gothic Medium font, a Korean font with fixed width strokes |
static int |
HYSMYEONGJO
Represents the HYS Myeongjo Medium font, a Korean font with variable width strokes |
static int |
ITALIC
A "style" parameter to the constructor requesting an italic font |
static int |
MHEI
Represents the MHei Medium font, a Traditional Chinese font with fixed width strokes |
static int |
MSUNG
Represents the MSung Light font, a Traditional Chinese font with variable width strokes |
static int |
REGULAR
A "style" parameter to the constructor requesting a regular font - ie. not bold or italic. |
static int |
STSONG
Represents the ST Song Light font, a Simplified Chinese font with variable width strokes |
Constructor Summary | |
StandardCJKFont(int font,
int style)
Create a new CJK Font. |
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 c1,
int c2)
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. |
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) |
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, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STSONG
public static final int MSUNG
public static final int MHEI
public static final int HEISEIMIN
public static final int HEISEIKAKUGO
public static final int HYGOTHIC
public static final int HYSMYEONGJO
public static final int REGULAR
public static final int BOLD
public static final int ITALIC
Constructor Detail |
public StandardCJKFont(int font, int style)
font
- The font to create. Can be one of STSONG
, MHEI
,
MSUNG
, HEISEIMIN
, HEISEIKAKUGO
, HYGOTHIC
,
or HYSMYEONGJO
.style
- a logical-OR of any of BOLD
, ITALIC
or REGULAR
Method Detail |
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 getDescender()
PDFFont
getDescender
in class PDFFont
public float getAscender()
PDFFont
getAscender
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 getUnderlineThickness()
PDFFont
getUnderlineThickness
in class PDFFont
public float getStrikeoutPosition()
PDFFont
getStrikeoutPosition
in class PDFFont
public float getStrikeoutThickness()
PDFFont
getStrikeoutThickness
in class PDFFont
public int getKerning(int c1, int c2)
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
c1
- a Unicode codepoint between U+0000 and U+10FFFDc2
- a Unicode codepoint between U+0000 and U+10FFFDpublic 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 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 boolean isMonospace()
PDFFont
isMonospace
in class PDFFont
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |