Public Member Functions | |
Font (String name, int styles, int charset, int weight) throws com.foxit.sdk.PDFException | |
Constructor, with given attribute. More... | |
Font (int font_id) throws com.foxit.sdk.PDFException | |
Constructor, by a standard font ID. More... | |
Font (String font_file_path, int face_index, int charset) throws com.foxit.sdk.PDFException | |
Constructor, from a font file. More... | |
Font (Font arg0) | |
Constructor, with another Font object. | |
Font | embed (PDFDoc document) throws com.foxit.sdk.PDFException |
Embed current font to the specified PDF document. More... | |
int | getAscent () throws com.foxit.sdk.PDFException |
Get the ascent value, in 1/1000 of em size (PDF units). More... | |
RectI | getCharBBox (int unicode) throws com.foxit.sdk.PDFException |
Get the bounding box of a character specified by unicode. More... | |
float | getCharWidth (int unicode) throws com.foxit.sdk.PDFException |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode. More... | |
int | getDescent () throws com.foxit.sdk.PDFException |
Get the descent value, in 1/1000 of em size (PDF units). More... | |
String | getName () throws com.foxit.sdk.PDFException |
Retrieve the face name. More... | |
boolean | isBold () throws com.foxit.sdk.PDFException |
Judge whether current font is bold or not. More... | |
boolean | isEmbedded (PDFDoc document) throws com.foxit.sdk.PDFException |
Judge whether current font is embedded in a specified PDF document or not. More... | |
boolean | isEmpty () |
Check whether current object is empty or not. More... | |
boolean | isItalic () throws com.foxit.sdk.PDFException |
Judge whether current font object is italic or not. More... | |
boolean | isSupportEmbedded (PDFDoc document) throws com.foxit.sdk.PDFException |
Check whether current font is supported to be embedded to the specified PDF document or not. More... | |
Static Public Attributes | |
static final int | e_CharsetANSI = 0 |
Font charset: ANSI (United States, Western Europe). | |
static final int | e_CharsetArabic = 178 |
Font charset: Arabic. | |
static final int | e_CharsetBaltic = 186 |
Font charset: Baltic. | |
static final int | e_CharsetChineseBig5 = 136 |
Font charset: Traditional Chinese. | |
static final int | e_CharsetDefault = 1 |
Font charset: System default, for unknown or mapping purpose. | |
static final int | e_CharsetEastEurope = 238 |
Font charset: Eastern European. | |
static final int | e_CharsetGB2312 = 134 |
Font charset: Simplified Chinese. | |
static final int | e_CharsetGreek = 161 |
Font charset: Greek. | |
static final int | e_CharsetHangeul = 129 |
Font charset: Korean (Wansung). | |
static final int | e_CharsetHebrew = 177 |
Font charset: Hebrew. | |
static final int | e_CharsetRussian = 204 |
Font charset: Russian. | |
static final int | e_CharsetShift_JIS = 128 |
Font charset: Japanese (Shift-JIS). | |
static final int | e_CharsetSymbol = 2 |
Font charset: Standard symbols. | |
static final int | e_CharsetThai = 222 |
Font charset: Thai. | |
static final int | e_CharsetTurkish = 162 |
Font charset: Turkish. | |
static final int | e_StdIDCourier = 0 |
Standard font: Courier. | |
static final int | e_StdIDCourierB = 1 |
Standard font: Courier-Bold. | |
static final int | e_StdIDCourierBI = 2 |
Standard font: Courier-BoldOblique, Bold italic. | |
static final int | e_StdIDCourierI = 3 |
Standard font: Courier-Oblique, Italic. | |
static final int | e_StdIDHelvetica = 4 |
Standard font: Helvetica. | |
static final int | e_StdIDHelveticaB = 5 |
Standard font: Helvetica-Bold. | |
static final int | e_StdIDHelveticaBI = 6 |
Standard font: Helvetica-BoldOblique, Bold italic. | |
static final int | e_StdIDHelveticaI = 7 |
Standard font: Helvetica-Oblique, Italic. | |
static final int | e_StdIDSymbol = 12 |
Standard font: Symbol. | |
static final int | e_StdIDTimes = 8 |
Standard font: Times-Roman. | |
static final int | e_StdIDTimesB = 9 |
Standard font: Times-Bold. | |
static final int | e_StdIDTimesBI = 10 |
Standard font: Times-BoldItalic. | |
static final int | e_StdIDTimesI = 11 |
Standard font: Times-Italic. | |
static final int | e_StdIDZapfDingbats = 13 |
Standard font: ZapfDingbats. | |
static final int | e_StyleAllCap = 0x10000 |
Font style: all cap. | |
static final int | e_StyleFixedPitch = 0x0001 |
Font style: fixed pitch. | |
static final int | e_StyleItalic = 0x0040 |
Font style: italic. | |
static final int | e_StyleNonSymbolic = 0x0020 |
Font style: non-symbolic. | |
static final int | e_StylesBold = 0x40000 |
Font style: force bold. | |
static final int | e_StyleScript = 0x0008 |
Font style: script. | |
static final int | e_StyleSerif = 0x0002 |
Font style: serif. | |
static final int | e_StylesSmallCap = 0x20000 |
Font style: small cap. | |
static final int | e_StyleSymbolic = 0x0004 |
Font style: symbolic. | |
In PDF document, font is used for drawing text in PDF page.
This class represents font used in Foxit PDF SDK. This class offers different constructor for user to construct a new Font object, by specified parameters, by standard font ID, or from a font file path. A Font object can also be retrieved directly from other object (such as free text annotation, a text graphics object, etc) in a PDF document. This class also offers some functions to get some basic information from a font.
com.foxit.sdk.common.Font.Font | ( | String | name, |
int | styles, | ||
int | charset, | ||
int | weight | ||
) | throws com.foxit.sdk.PDFException |
Constructor, with given attribute.
This function is to construct font based on system fonts.
name | The PostScript name of the font to be created. |
styles | Font styles. Please refer to values starting from e_StyleFixedPitch and this can be one or a combination of these values. |
charset | The charset of the font to be created. Please refer to values starting from e_CharsetANSI and this should be one of these values. |
weight | Original font weight. 0 means unspecified. |
com.foxit.sdk.common.Font.Font | ( | int | font_id | ) | throws com.foxit.sdk.PDFException |
Constructor, by a standard font ID.
font_id | Standard font ID of the font to be created. Please refer to values starting from e_StdIDCourier and this should be one of these values. |
com.foxit.sdk.common.Font.Font | ( | String | font_file_path, |
int | face_index, | ||
int | charset | ||
) | throws com.foxit.sdk.PDFException |
Constructor, from a font file.
font_file_path | A full path to an existing font file. |
face_index | The zero-based face index. Valid range: from 0 to (face_count-1). Please call the system functions to get the face_count. |
charset | The charset of the font to be created. Please refer to values starting from e_CharsetANSI and this should be one of these values. |
Font com.foxit.sdk.common.Font.embed | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
Embed current font to the specified PDF document.
document | A valid PDF document object. |
int com.foxit.sdk.common.Font.getAscent | ( | ) | throws com.foxit.sdk.PDFException |
Get the ascent value, in 1/1000 of em size (PDF units).
RectI com.foxit.sdk.common.Font.getCharBBox | ( | int | unicode | ) | throws com.foxit.sdk.PDFException |
Get the bounding box of a character specified by unicode.
unicode | A character unicode value. |
float com.foxit.sdk.common.Font.getCharWidth | ( | int | unicode | ) | throws com.foxit.sdk.PDFException |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
unicode | A character unicode value. |
int com.foxit.sdk.common.Font.getDescent | ( | ) | throws com.foxit.sdk.PDFException |
Get the descent value, in 1/1000 of em size (PDF units).
String com.foxit.sdk.common.Font.getName | ( | ) | throws com.foxit.sdk.PDFException |
Retrieve the face name.
boolean com.foxit.sdk.common.Font.isBold | ( | ) | throws com.foxit.sdk.PDFException |
Judge whether current font is bold or not.
boolean com.foxit.sdk.common.Font.isEmbedded | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
Judge whether current font is embedded in a specified PDF document or not.
document | A valid PDF document object. |
boolean com.foxit.sdk.common.Font.isEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
boolean com.foxit.sdk.common.Font.isItalic | ( | ) | throws com.foxit.sdk.PDFException |
Judge whether current font object is italic or not.
boolean com.foxit.sdk.common.Font.isSupportEmbedded | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
Check whether current font is supported to be embedded to the specified PDF document or not.
document | A valid PDF document object. |