Foxit PDF SDK
|
Instance Methods | |
(FSUInt32Array *) | - addUnicodes:unicode_array: |
Add unicodes to current embedded font. More... | |
(FSFont *) | - embed:is_add_all_unicodes: |
Embed current font to the specified PDF document. More... | |
(int) | - getAscent |
Get the ascent value, in 1/1000 of em size (PDF units). More... | |
(NSString *) | - getBaseFontName: |
Get base font name. More... | |
(FSRectI *) | - getCharBBox: |
Get the bounding box of a character specified by unicode. More... | |
(FSRectI *) | - getCharBBoxWithPDFDoc:document: |
Get the bounding box of a character(specified by unicode) in a PDF document. More... | |
(float) | - getCharWidth: |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode. More... | |
(float) | - getCharWidthWithPDFDoc:document: |
Get the width (in 1/1000 of em size, as PDF units) of a character (specified by unicode) in a PDF document. More... | |
(FSFontCIDCharset) | - getCIDCharset: |
Get CID font charset. More... | |
(int) | - getDescent |
Get the descent value, in 1/1000 of em size (PDF units). More... | |
(NSString *) | - getEncoding: |
Get the current font encoding. More... | |
(NSString *) | - getFamilyName |
Retrieve the famliy name. More... | |
(FSFontFontTypes) | - getFontType: |
Get font type. More... | |
(NSString *) | - getName |
Retrieve the postscript name. More... | |
(FSFontStandardID) | - getStandard14Font: |
Get standard font ID. More... | |
(unsigned int) | - getStyles: |
Get font styles. More... | |
(id) | - initWithFont_file_path:face_index:charset: |
Constructor, from a font file. More... | |
(id) | - initWithFont_id: |
Constructor, by a standard font ID. More... | |
(id) | - initWithName:styles:charset:weight: |
Constructor, with given attribute. More... | |
(id) | - initWithOther: |
Constructor, with another font object. More... | |
(BOOL) | - isBold |
Judge whether current font is bold or not. More... | |
(BOOL) | - isEmbedded: |
Judge whether current font is embedded in a specified PDF document or not. More... | |
(BOOL) | - isEmpty |
Check whether current object is empty or not. More... | |
(BOOL) | - isItalic |
Judge whether current font object is italic or not. More... | |
(BOOL) | - isStandardFont: |
Check whether current font is a standard font. More... | |
(BOOL) | - isSupportEmbedded: |
Check whether current font is supported to be embedded to the specified PDF document or not. More... | |
(BOOL) | - isVertWriting: |
Check whether current font is vertical writing. More... | |
(BOOL) | - setEncoding:value: |
Set the current font encoding. More... | |
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.
- (FSUInt32Array *) addUnicodes: | (FSPDFDoc*) | document | |
unicode_array: | (FSUInt32Array*) | 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. |
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. YES means embeded unicodes that are from 0x0 to 0xFFFF, while NO means that just embeded one unicode. Default: YES. Users can add unicodes via FSFont::addUnicodes:unicode_array:. |
- (int) getAscent |
Get the ascent value, in 1/1000 of em size (PDF units).
- (NSString *) getBaseFontName: | (FSPDFDoc*) | document |
Get base font name.
[in] | document | A valid PDF document object. |
- (FSRectI *) getCharBBox: | (unsigned int) | unicode |
Get the bounding box of a character specified by unicode.
[in] | unicode | A character unicode value. |
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. |
- (float) getCharWidth: | (unsigned int) | unicode |
Get the width (in 1/1000 of em size (PDF units)) of a character specified by unicode.
[in] | unicode | A character unicode value. |
- (float) getCharWidthWithPDFDoc: | (unsigned int) | unicode | |
document: | (FSPDFDoc*) | 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. |
- (FSFontCIDCharset) getCIDCharset: | (FSPDFDoc*) | document |
Get CID font charset.
Applicable for CID based fonts. For rest type of font, exception FSErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
- (int) getDescent |
Get the descent value, in 1/1000 of em size (PDF units).
- (NSString *) getEncoding: | (FSPDFDoc*) | document |
Get the current font encoding.
[in] | document | A valid PDF document object. |
- (NSString *) getFamilyName |
Retrieve the famliy name.
- (FSFontFontTypes) getFontType: | (FSPDFDoc*) | document |
Get font type.
[in] | document | A valid PDF document object. |
- (NSString *) getName |
Retrieve the postscript name.
- (FSFontStandardID) getStandard14Font: | (FSPDFDoc*) | document |
Get standard font ID.
Applicable for standard fonts. For rest type of font, exception FSErrUnsupported will be thrown.
[in] | document | A valid PDF document object. |
- (unsigned int) getStyles: | (FSPDFDoc*) | document |
Get font styles.
[in] | document | A valid PDF document object. |
- (id) initWithFont_file_path: | (NSString *) | font_file_path | |
face_index: | (int) | face_index | |
charset: | (FSFontCharset) | 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 FSFontCharsetANSI and this should be one of these values. |
- (id) initWithFont_id: | (FSFontStandardID) | 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 FSFontStdIDCourier and this should be one of these values. |
- (id) initWithName: | (NSString *) | name | |
styles: | (unsigned int) | styles | |
charset: | (FSFontCharset) | charset | |
weight: | (int) | 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 FSFontStyleFixedPitch 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 FSFontCharsetANSI and this should be one of these values. |
[in] | weight | Original font weight. 0 means unspecified. |
- (id) initWithOther: | (FSFont*) | other |
Constructor, with another font object.
[in] | other | Another font object. |
- (BOOL) isBold |
Judge whether current font is bold or not.
- (BOOL) isEmbedded: | (FSPDFDoc*) | document |
Judge whether current font is embedded in a specified PDF document or not.
[in] | document | A valid PDF document object. |
- (BOOL) isEmpty |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
- (BOOL) isItalic |
Judge whether current font object is italic or not.
- (BOOL) isStandardFont: | (FSPDFDoc*) | document |
Check whether current font is a standard font.
[in] | document | A valid PDF document object. |
- (BOOL) isSupportEmbedded: | (FSPDFDoc*) | document |
Check whether current font is supported to be embedded to the specified PDF document or not.
[in] | document | A valid PDF document object. |
- (BOOL) isVertWriting: | (FSPDFDoc*) | document |
Check whether current font is vertical writing.
[in] | document | A valid PDF document object. |
- (BOOL) setEncoding: | (FSPDFDoc*) | document | |
value: | (NSString *) | 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. |