Foxit PDF SDK
|
Public Member Functions | |
AddUnicodes (document, unicode_array) | |
Add unicodes to current embedded font. More... | |
constructor (font_file_path, face_index, charset) | |
Constructor, from a font file. More... | |
constructor (font_id) | |
Constructor, by a standard font ID. More... | |
constructor (name, styles, charset, weight) | |
Constructor, with given attribute. More... | |
Embed (document, is_add_all_unicodes) | |
Embed current font to the specified PDF document. More... | |
GetAscent () | |
Get the ascent value, in 1/1000 of em size (PDF units). More... | |
GetBaseFontName (document) | |
Get base font name. More... | |
GetCharBBox (unicode) | |
Get the bounding box of a character specified by unicode. More... | |
GetCharBBox (unicode, document) | |
Get the bounding box of a character(specified by unicode) in a PDF document. More... | |
GetCharWidth (unicode) | |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode. More... | |
GetCharWidth (unicode, document) | |
Get the width (in 1/1000 of em size, as PDF units) of a character (specified by unicode) in a PDF document. More... | |
GetCIDCharset (document) | |
Get CID font charset. More... | |
GetDescent () | |
Get the descent value, in 1/1000 of em size (PDF units). More... | |
GetEncoding (document) | |
Get the current font encoding. More... | |
GetFamilyName () | |
Retrieve the famliy name. More... | |
GetFontType (document) | |
Get font type. More... | |
GetName () | |
Retrieve the postscript name. More... | |
GetStandard14Font (document) | |
Get standard font ID. More... | |
GetStyles (document) | |
Get font styles. More... | |
IsBold () | |
Judge whether current font is bold or not. More... | |
IsEmbedded (document) | |
Judge whether current font is embedded in a specified PDF document or not. More... | |
IsEmpty () | |
Check whether current object is empty or not. More... | |
IsItalic () | |
Judge whether current font object is italic or not. More... | |
IsStandardFont (document) | |
Check whether current font is a standard font. More... | |
IsSupportEmbedded (document) | |
Check whether current font is supported to be embedded to the specified PDF document or not. More... | |
IsVertWriting (document) | |
Check whether current font is vertical writing. More... | |
SetEncoding (document, value) | |
Set the current font encoding. More... | |
Static Public Attributes | |
static | e_CharsetANSI |
Enumeration for font charset. More... | |
static | e_CharsetArabic |
Font charset: Arabic. | |
static | e_CharsetBaltic |
Font charset: Baltic. | |
static | e_CharsetChineseBig5 |
Font charset: Traditional Chinese. | |
static | e_CharsetDefault |
Font charset: System default, for unknown or mapping purpose. | |
static | e_CharsetEastEurope |
Font charset: Eastern European. | |
static | e_CharsetGB2312 |
Font charset: Simplified Chinese. | |
static | e_CharsetGreek |
Font charset: Greek. | |
static | e_CharsetHangeul |
Font charset: Korean (Wansung). | |
static | e_CharsetHebrew |
Font charset: Hebrew. | |
static | e_CharsetRussian |
Font charset: Russian. | |
static | e_CharsetShift_JIS |
Font charset: Japanese (Shift-JIS). | |
static | e_CharsetSymbol |
Font charset: Standard symbols. | |
static | e_CharsetThai |
Font charset: Thai. | |
static | e_CharsetTurkish |
Font charset: Turkish. | |
static | e_CIDCharsetCNS1 |
CID Font charset: Adobe-CNS1. | |
static | e_CIDCharsetGB1 |
CID Font charset: Adobe-GB1. | |
static | e_CIDCharsetJAPAN1 |
CID Font charset: Adobe-Japan1. | |
static | e_CIDCharsetKOREA1 |
CID Font charset: Adobe-Korea1. | |
static | e_CIDCharsetUNICODE |
CID Font charset: Unicode. | |
static | e_CIDCharsetUnknown |
Enumeration for CID font charset. More... | |
static | e_FontTypeCIDFont |
Font type: CID font. | |
static | e_FontTypeTrueType |
Font type: TrueType. | |
static | e_FontTypeType1 |
Enumeration for font type. More... | |
static | e_FontTypeType3 |
Font type: Type3. | |
static | e_StdIDCourier |
Enumeration for standard font ID. More... | |
static | e_StdIDCourierB |
Standard font: Courier-Bold. | |
static | e_StdIDCourierBI |
Standard font: Courier-BoldOblique, Bold italic. | |
static | e_StdIDCourierI |
Standard font: Courier-Oblique, Italic. | |
static | e_StdIDHelvetica |
Standard font: Helvetica. | |
static | e_StdIDHelveticaB |
Standard font: Helvetica-Bold. | |
static | e_StdIDHelveticaBI |
Standard font: Helvetica-BoldOblique, Bold italic. | |
static | e_StdIDHelveticaI |
Standard font: Helvetica-Oblique, Italic. | |
static | e_StdIDSymbol |
Standard font: Symbol. | |
static | e_StdIDTimes |
Standard font: Times-Roman. | |
static | e_StdIDTimesB |
Standard font: Times-Bold. | |
static | e_StdIDTimesBI |
Standard font: Times-BoldItalic. | |
static | e_StdIDTimesI |
Standard font: Times-Italic. | |
static | e_StdIDZapfDingbats |
Standard font: ZapfDingbats. | |
static | e_StyleAllCap |
Font style: all cap. | |
static | e_StyleFixedPitch |
Enumeration for font styles. More... | |
static | e_StyleItalic |
Font style: italic. | |
static | e_StyleNonSymbolic |
Font style: non-symbolic. | |
static | e_StylesBold |
Font style: force bold. | |
static | e_StyleScript |
Font style: script. | |
static | e_StyleSerif |
Font style: serif. | |
static | e_StylesSmallCap |
Font style: small cap. | |
static | e_StyleSymbolic |
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.
FSDK.Font.AddUnicodes | ( | document | , |
unicode_array | |||
) |
Add unicodes to current embedded font.
This function only support newly embedded font.
[in] | document | A valid PDF document object. |
[in] | unicode_array | The unicode array to be embedded. |
FSDK.Font.constructor | ( | font_file_path | , |
face_index | , | ||
charset | |||
) |
Constructor, from a font file.
[in] | font_file_path | A full path to an existing font file. |
[in] | 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. |
[in] | charset | The charset of the font to be created. Please refer to values starting from FSDK.Font.e_CharsetANSI and this should be one of these values. |
FSDK.Font.constructor | ( | font_id | ) |
Constructor, by a standard font ID.
[in] | font_id | Standard font ID of the font to be created. Please refer to values starting from FSDK.Font.e_StdIDCourier and this should be one of these values. |
FSDK.Font.constructor | ( | name | , |
styles | , | ||
charset | , | ||
weight | |||
) |
Constructor, with given attribute.
This function is to construct font based on system fonts.
[in] | name | The PostScript name of the font to be created. |
[in] | styles | Font styles. Please refer to values starting from FSDK.Font.e_StyleFixedPitch and this can be one or a combination of these values. |
[in] | charset | The charset of the font to be created. Please refer to values starting from FSDK.Font.e_CharsetANSI and this should be one of these values. |
[in] | weight | Original font weight. 0 means unspecified. |
FSDK.Font.Embed | ( | document | , |
is_add_all_unicodes | |||
) |
Embed current font to the specified PDF document.
[in] | document | A valid PDF document object. |
[in] | is_add_all_unicodes | Whether to add unicodes that are from 0x0 to 0xFFFF to current embedded font if no unicodes which are in document are added. true means embeded unicodes that are from 0x0 to 0xFFFF, while false means that just embeded one unicode. Default: true. Users can add unicodes via FSDK.Font.AddUnicodes. |
FSDK.Font.GetAscent | ( | ) |
Get the ascent value, in 1/1000 of em size (PDF units).
FSDK.Font.GetBaseFontName | ( | document | ) |
Get base font name.
[in] | document | A valid PDF document object. |
FSDK.Font.GetCharBBox | ( | unicode | ) |
Get the bounding box of a character specified by unicode.
[in] | unicode | A character unicode value. |
FSDK.Font.GetCharBBox | ( | unicode | , |
document | |||
) |
Get the bounding box of a character(specified by unicode) in a PDF document.
[in] | unicode | A character unicode value. |
[in] | document | A valid PDF document object. |
FSDK.Font.GetCharWidth | ( | unicode | ) |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
[in] | unicode | A character unicode value. |
FSDK.Font.GetCharWidth | ( | unicode | , |
document | |||
) |
Get the width (in 1/1000 of em size, as PDF units) of a character (specified by unicode) in a PDF document.
[in] | unicode | A character unicode value. |
[in] | document | A valid PDF document object. |
FSDK.Font.GetCIDCharset | ( | document | ) |
Get CID font charset.
Applicable for CID based fonts. For rest type of font, exception FSDK.e_ErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
FSDK.Font.GetDescent | ( | ) |
Get the descent value, in 1/1000 of em size (PDF units).
FSDK.Font.GetEncoding | ( | document | ) |
Get the current font encoding.
[in] | document | A valid PDF document object. |
FSDK.Font.GetFamilyName | ( | ) |
Retrieve the famliy name.
FSDK.Font.GetFontType | ( | document | ) |
Get font type.
[in] | document | A valid PDF document object. |
FSDK.Font.GetName | ( | ) |
Retrieve the postscript name.
FSDK.Font.GetStandard14Font | ( | document | ) |
Get standard font ID.
Applicable for standard fonts. For rest type of font, exception FSDK.e_ErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
FSDK.Font.GetStyles | ( | document | ) |
Get font styles.
[in] | document | A valid PDF document object. |
FSDK.Font.IsBold | ( | ) |
Judge whether current font is bold or not.
FSDK.Font.IsEmbedded | ( | document | ) |
Judge whether current font is embedded in a specified PDF document or not.
[in] | document | A valid PDF document object. |
FSDK.Font.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
FSDK.Font.IsItalic | ( | ) |
Judge whether current font object is italic or not.
FSDK.Font.IsStandardFont | ( | document | ) |
Check whether current font is a standard font.
[in] | document | A valid PDF document object. |
FSDK.Font.IsSupportEmbedded | ( | document | ) |
Check whether current font is supported to be embedded to the specified PDF document or not.
[in] | document | A valid PDF document object. |
FSDK.Font.IsVertWriting | ( | document | ) |
Check whether current font is vertical writing.
[in] | document | A valid PDF document object. |
FSDK.Font.SetEncoding | ( | document | , |
value | |||
) |
Set the current font encoding.
[in] | document | A valid PDF document object. |
[in] | value | The font encoding to be set. For encoding values, please refer to "TABLE 5.15 Predefined CJK CMap names" in <PDF reference 1.7> P442. This parameter should not be an empty string. |
|
static |
Enumeration for font charset.
Values of this enumeration should be used alone.
Font charset: ANSI (United States, Western Europe).
|
static |
Enumeration for CID font charset.
Values of this enumeration should be used alone.
CID Font charset: Unknown.
|
static |
Enumeration for font type.
Values of this enumeration can be used alone .
Font type: Type1.
|
static |
Enumeration for standard font ID.
Values of this enumeration should be used alone.
Standard font: Courier.
|
static |
Enumeration for font styles.
Values of this enumeration can be used alone or in combination.
Font style: fixed pitch.