Foxit PDF SDK
|
Public Member Functions | |
def | Font (name, styles, charset, weight) |
Constructor, with given attribute. More... | |
def | Embed (document) |
Embed current font to the specified PDF document. More... | |
def | GetAscent () |
Get the ascent value, in 1/1000 of em size (PDF units). More... | |
def | GetBaseFontName (document) |
Get base font name. More... | |
def | GetCharBBox (unicode) |
Get the bounding box of a character specified by unicode. More... | |
def | GetCharWidth (unicode) |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode. More... | |
def | GetCIDCharset (document) |
Get CID font charset. More... | |
def | GetDescent () |
Get the descent value, in 1/1000 of em size (PDF units). More... | |
def | GetEncoding (document) |
Get the current font encoding. More... | |
def | GetFamilyName () |
Retrieve the famliy name. More... | |
def | GetFontType (document) |
Get font type. More... | |
def | GetName () |
Retrieve the postscript name. More... | |
def | GetStandard14Font (document) |
Get standard font ID. More... | |
def | GetStyles (document) |
Get font styles. More... | |
def | IsBold () |
Judge whether current font is bold or not. More... | |
def | IsEmbedded (document) |
Judge whether current font is embedded in a specified PDF document or not. More... | |
def | IsEmpty () |
Check whether current object is empty or not. More... | |
def | IsItalic () |
Judge whether current font object is italic or not. More... | |
def | IsStandardFont (document) |
Check whether current font is a standard font. More... | |
def | IsSupportEmbedded (document) |
Check whether current font is supported to be embedded to the specified PDF document or not. More... | |
def | IsVertWriting (document) |
Check whether current font is vertical writing. More... | |
def | SetEncoding (document, value) |
Set the current font encoding. More... | |
Static Public Attributes | |
e_CharsetANSI = _fsdk.Font_e_CharsetANSI | |
Font charset: ANSI (United States, Western Europe). | |
e_CharsetArabic = _fsdk.Font_e_CharsetArabic | |
Font charset: Arabic. | |
e_CharsetBaltic = _fsdk.Font_e_CharsetBaltic | |
Font charset: Baltic. | |
e_CharsetChineseBig5 = _fsdk.Font_e_CharsetChineseBig5 | |
Font charset: Traditional Chinese. | |
e_CharsetDefault = _fsdk.Font_e_CharsetDefault | |
Font charset: System default, for unknown or mapping purpose. | |
e_CharsetEastEurope = _fsdk.Font_e_CharsetEastEurope | |
Font charset: Eastern European. | |
e_CharsetGB2312 = _fsdk.Font_e_CharsetGB2312 | |
Font charset: Simplified Chinese. | |
e_CharsetGreek = _fsdk.Font_e_CharsetGreek | |
Font charset: Greek. | |
e_CharsetHangeul = _fsdk.Font_e_CharsetHangeul | |
Font charset: Korean (Wansung). | |
e_CharsetHebrew = _fsdk.Font_e_CharsetHebrew | |
Font charset: Hebrew. | |
e_CharsetRussian = _fsdk.Font_e_CharsetRussian | |
Font charset: Russian. | |
e_CharsetShift_JIS = _fsdk.Font_e_CharsetShift_JIS | |
Font charset: Japanese (Shift-JIS). | |
e_CharsetSymbol = _fsdk.Font_e_CharsetSymbol | |
Font charset: Standard symbols. | |
e_CharsetThai = _fsdk.Font_e_CharsetThai | |
Font charset: Thai. | |
e_CharsetTurkish = _fsdk.Font_e_CharsetTurkish | |
Font charset: Turkish. | |
e_CIDCharsetCNS1 = _fsdk.Font_e_CIDCharsetCNS1 | |
CID Font charset: Adobe-CNS1. | |
e_CIDCharsetGB1 = _fsdk.Font_e_CIDCharsetGB1 | |
CID Font charset: Adobe-GB1. | |
e_CIDCharsetJAPAN1 = _fsdk.Font_e_CIDCharsetJAPAN1 | |
CID Font charset: Adobe-Japan1. | |
e_CIDCharsetKOREA1 = _fsdk.Font_e_CIDCharsetKOREA1 | |
CID Font charset: Adobe-Korea1. | |
e_CIDCharsetUNICODE = _fsdk.Font_e_CIDCharsetUNICODE | |
CID Font charset: Unicode. | |
e_CIDCharsetUnknown = _fsdk.Font_e_CIDCharsetUnknown | |
CID Font charset: Unknown. | |
e_FontTypeCIDFont = _fsdk.Font_e_FontTypeCIDFont | |
Font type: CID font. | |
e_FontTypeTrueType = _fsdk.Font_e_FontTypeTrueType | |
Font type: TrueType. | |
e_FontTypeType1 = _fsdk.Font_e_FontTypeType1 | |
Font type: Type1. | |
e_FontTypeType3 = _fsdk.Font_e_FontTypeType3 | |
Font type: Type3. | |
e_StdIDCourier = _fsdk.Font_e_StdIDCourier | |
Standard font: Courier. | |
e_StdIDCourierB = _fsdk.Font_e_StdIDCourierB | |
Standard font: Courier-Bold. | |
e_StdIDCourierBI = _fsdk.Font_e_StdIDCourierBI | |
Standard font: Courier-BoldOblique, Bold italic. | |
e_StdIDCourierI = _fsdk.Font_e_StdIDCourierI | |
Standard font: Courier-Oblique, Italic. | |
e_StdIDHelvetica = _fsdk.Font_e_StdIDHelvetica | |
Standard font: Helvetica. | |
e_StdIDHelveticaB = _fsdk.Font_e_StdIDHelveticaB | |
Standard font: Helvetica-Bold. | |
e_StdIDHelveticaBI = _fsdk.Font_e_StdIDHelveticaBI | |
Standard font: Helvetica-BoldOblique, Bold italic. | |
e_StdIDHelveticaI = _fsdk.Font_e_StdIDHelveticaI | |
Standard font: Helvetica-Oblique, Italic. | |
e_StdIDSymbol = _fsdk.Font_e_StdIDSymbol | |
Standard font: Symbol. | |
e_StdIDTimes = _fsdk.Font_e_StdIDTimes | |
Standard font: Times-Roman. | |
e_StdIDTimesB = _fsdk.Font_e_StdIDTimesB | |
Standard font: Times-Bold. | |
e_StdIDTimesBI = _fsdk.Font_e_StdIDTimesBI | |
Standard font: Times-BoldItalic. | |
e_StdIDTimesI = _fsdk.Font_e_StdIDTimesI | |
Standard font: Times-Italic. | |
e_StdIDZapfDingbats = _fsdk.Font_e_StdIDZapfDingbats | |
Standard font: ZapfDingbats. | |
e_StyleAllCap = _fsdk.Font_e_StyleAllCap | |
Font style: all cap. | |
e_StyleFixedPitch = _fsdk.Font_e_StyleFixedPitch | |
Font style: fixed pitch. | |
e_StyleItalic = _fsdk.Font_e_StyleItalic | |
Font style: italic. | |
e_StyleNonSymbolic = _fsdk.Font_e_StyleNonSymbolic | |
Font style: non-symbolic. | |
e_StylesBold = _fsdk.Font_e_StylesBold | |
Font style: force bold. | |
e_StyleScript = _fsdk.Font_e_StyleScript | |
Font style: script. | |
e_StyleSerif = _fsdk.Font_e_StyleSerif | |
Font style: serif. | |
e_StylesSmallCap = _fsdk.Font_e_StylesSmallCap | |
Font style: small cap. | |
e_StyleSymbolic = _fsdk.Font_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.
def FoxitPDFSDKPython3.Font.Font | ( | name, | |
styles, | |||
charset, | |||
weight | |||
) |
Constructor, with given attribute.
Constructor, with another font object.
Constructor, from a font file.
Constructor, by a standard font ID.
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 FoxitPDFSDKPython3.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 FoxitPDFSDKPython3.Font.e_CharsetANSI and this should be one of these values. |
[in] | weight | Original font weight. 0 means unspecified. |
[in] | font_id | Standard font ID of the font to be created. Please refer to values starting from FoxitPDFSDKPython3.Font.e_StdIDCourier and this should be one of these values. |
[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 FoxitPDFSDKPython3.Font.e_CharsetANSI and this should be one of these values. |
[in] | other | Another font object. |
def FoxitPDFSDKPython3.Font.Embed | ( | document | ) |
Embed current font to the specified PDF document.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetAscent | ( | ) |
Get the ascent value, in 1/1000 of em size (PDF units).
def FoxitPDFSDKPython3.Font.GetBaseFontName | ( | document | ) |
Get base font name.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetCharBBox | ( | unicode | ) |
Get the bounding box of a character specified by unicode.
Get the bounding box of a character(specified by unicode) in a PDF document.
[in] | unicode | A character unicode value. |
[in] | unicode | A character unicode value. |
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetCharWidth | ( | unicode | ) |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
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] | unicode | A character unicode value. |
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetCIDCharset | ( | document | ) |
Get CID font charset.
Applicable for CID based fonts. For rest type of font, exception FoxitPDFSDKPython3.e_ErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetDescent | ( | ) |
Get the descent value, in 1/1000 of em size (PDF units).
def FoxitPDFSDKPython3.Font.GetEncoding | ( | document | ) |
Get the current font encoding.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetFamilyName | ( | ) |
Retrieve the famliy name.
def FoxitPDFSDKPython3.Font.GetFontType | ( | document | ) |
Get font type.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetName | ( | ) |
Retrieve the postscript name.
def FoxitPDFSDKPython3.Font.GetStandard14Font | ( | document | ) |
Get standard font ID.
Applicable for standard fonts. For rest type of font, exception FoxitPDFSDKPython3.e_ErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.GetStyles | ( | document | ) |
Get font styles.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.IsBold | ( | ) |
Judge whether current font is bold or not.
def FoxitPDFSDKPython3.Font.IsEmbedded | ( | document | ) |
Judge whether current font is embedded in a specified PDF document or not.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.Font.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
def FoxitPDFSDKPython3.Font.IsItalic | ( | ) |
Judge whether current font object is italic or not.
def FoxitPDFSDKPython3.Font.IsStandardFont | ( | document | ) |
Check whether current font is a standard font.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.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. |
def FoxitPDFSDKPython3.Font.IsVertWriting | ( | document | ) |
Check whether current font is vertical writing.
[in] | document | A valid PDF document object. |
def FoxitPDFSDKPython3.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.