|
Foxit PDF SDK
|
Public 成员函数 | |
| Font (Font other) | |
| 使用另一个字体对象的构造函数。 更多... | |
| Font (int font_id) throws com.foxit.sdk.PDFException | |
| 通过标准字体ID的构造函数。 更多... | |
| Font (StreamCallback stream) throws com.foxit.sdk.PDFException | |
| 通过使用 com.foxit.sdk.common.fxcrt.StreamCallback 从字体流的构造函数。 更多... | |
| Font (String font_file_path, int face_index, int charset) throws com.foxit.sdk.PDFException | |
| 从字体文件的构造函数。 更多... | |
| Font (String name, int styles, int charset, int weight) throws com.foxit.sdk.PDFException | |
| 带有给定属性的构造函数。 更多... | |
| UInt32Array | addUnicodes (PDFDoc document, UInt32Array unicode_array) throws com.foxit.sdk.PDFException |
| 向当前嵌入字体添加Unicode字符。 更多... | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
| Font | embed (PDFDoc document, boolean is_add_all_unicodes) throws com.foxit.sdk.PDFException |
| 将当前字体嵌入到指定的PDF文档中。 更多... | |
| int | getAscent () throws com.foxit.sdk.PDFException |
| 获取上升值,以1/1000 em大小为单位(PDF单位)。 更多... | |
| String | getBaseFontName (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取基础字体名称。 更多... | |
| RectI | getCharBBox (int unicode) throws com.foxit.sdk.PDFException |
| 获取由Unicode指定的字符的边界框。 更多... | |
| RectI | getCharBBox (int unicode, PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取PDF文档中由Unicode指定的字符的边界框。 更多... | |
| float | getCharWidth (int unicode) throws com.foxit.sdk.PDFException |
| 获取由Unicode指定的字符的宽度(以1/1000 em大小为单位(PDF单位))。 更多... | |
| float | getCharWidth (int unicode, PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取PDF文档中由Unicode指定的字符的宽度(以1/1000 em大小为单位,作为PDF单位)。 更多... | |
| int | getCIDCharset (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取CID字体字符集。 更多... | |
| int | getDescent () throws com.foxit.sdk.PDFException |
| 获取下降值,以1/1000 em大小为单位(PDF单位)。 更多... | |
| String | getEncoding (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取当前字体编码。 更多... | |
| String | getFamilyName () throws com.foxit.sdk.PDFException |
| 检索字体族名称。 更多... | |
| int | getFontType (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取字体类型。 更多... | |
| String | getName () throws com.foxit.sdk.PDFException |
| 检索PostScript名称。 更多... | |
| int | getStandard14Font (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取标准字体ID。 更多... | |
| int | getStyles (PDFDoc document) throws com.foxit.sdk.PDFException |
| 获取字体样式。 更多... | |
| boolean | isBold () throws com.foxit.sdk.PDFException |
| 判断当前字体是否为粗体。 更多... | |
| boolean | isCharSupported (int unicode, PDFDoc document) throws com.foxit.sdk.PDFException |
| 检查当前字体是否支持某字符。 更多... | |
| boolean | isEmbedded (PDFDoc document) throws com.foxit.sdk.PDFException |
| 判断当前字体是否嵌入在指定的PDF文档中。 更多... | |
| boolean | isEmpty () |
| 检查当前对象是否为空。 更多... | |
| boolean | isItalic () throws com.foxit.sdk.PDFException |
| 判断当前字体对象是否为斜体。 更多... | |
| boolean | isStandardFont (PDFDoc document) throws com.foxit.sdk.PDFException |
| 检查当前字体是否为标准字体。 更多... | |
| boolean | isSupportEmbedded (PDFDoc document) throws com.foxit.sdk.PDFException |
| 检查当前字体是否支持嵌入到指定的PDF文档中。 更多... | |
| boolean | isVertWriting (PDFDoc document) throws com.foxit.sdk.PDFException |
| 检查当前字体是否为垂直书写。 更多... | |
| boolean | setEncoding (PDFDoc document, String value) throws com.foxit.sdk.PDFException |
| 设置当前字体编码。 更多... | |
静态 Public 属性 | |
| static final int | e_CharsetANSI = 0 |
| 字体字符集:ANSI(美国、西欧)。 | |
| static final int | e_CharsetArabic = 178 |
| 字体字符集:阿拉伯文。 | |
| static final int | e_CharsetBaltic = 186 |
| 字体字符集:波罗的海文。 | |
| static final int | e_CharsetChineseBig5 = 136 |
| 字体字符集:繁体中文。 | |
| static final int | e_CharsetDefault = 1 |
| 字体字符集:系统默认,用于未知或映射目的。 | |
| static final int | e_CharsetEastEurope = 238 |
| 字体字符集:东欧。 | |
| static final int | e_CharsetGB2312 = 134 |
| 字体字符集:简体中文。 | |
| static final int | e_CharsetGreek = 161 |
| 字体字符集:希腊文。 | |
| static final int | e_CharsetHangeul = 129 |
| 字体字符集:韩文(Wansung)。 | |
| static final int | e_CharsetHebrew = 177 |
| 字体字符集:希伯来文。 | |
| static final int | e_CharsetRussian = 204 |
| 字体字符集:俄文。 | |
| static final int | e_CharsetShift_JIS = 128 |
| 字体字符集:日文(Shift-JIS)。 | |
| static final int | e_CharsetSymbol = 2 |
| 字体字符集:标准符号。 | |
| static final int | e_CharsetThai = 222 |
| 字体字符集:泰文。 | |
| static final int | e_CharsetTurkish = 162 |
| 字体字符集:土耳其文。 | |
| static final int | e_CIDCharsetCNS1 = 2 |
| CID字体字符集:Adobe-CNS1。 | |
| static final int | e_CIDCharsetGB1 = 1 |
| CID字体字符集:Adobe-GB1。 | |
| static final int | e_CIDCharsetJAPAN1 = 3 |
| CID字体字符集:Adobe-Japan1。 | |
| static final int | e_CIDCharsetKOREA1 = 4 |
| CID字体字符集:Adobe-Korea1。 | |
| static final int | e_CIDCharsetUNICODE = 5 |
| CID字体字符集:Unicode。 | |
| static final int | e_CIDCharsetUnknown = 0 |
| CID字体字符集:未知。 | |
| static final int | e_FontTypeCIDFont = 4 |
| 字体类型:CID 字体。 | |
| static final int | e_FontTypeTrueType = 2 |
| 字体类型:TrueType。 | |
| static final int | e_FontTypeType1 = 1 |
| 字体类型:Type1。 | |
| static final int | e_FontTypeType3 = 3 |
| 字体类型:Type3。 | |
| static final int | e_StdIDCourier = 0 |
| 标准字体:Courier。 | |
| static final int | e_StdIDCourierB = 1 |
| 标准字体:Courier-Bold。 | |
| static final int | e_StdIDCourierBI = 2 |
| 标准字体:Courier-BoldOblique,粗斜体。 | |
| static final int | e_StdIDCourierI = 3 |
| 标准字体:Courier-Oblique,斜体。 | |
| static final int | e_StdIDHelvetica = 4 |
| 标准字体:Helvetica。 | |
| static final int | e_StdIDHelveticaB = 5 |
| 标准字体:Helvetica-Bold。 | |
| static final int | e_StdIDHelveticaBI = 6 |
| 标准字体:Helvetica-BoldOblique,粗斜体。 | |
| static final int | e_StdIDHelveticaI = 7 |
| 标准字体:Helvetica-Oblique,斜体。 | |
| static final int | e_StdIDSymbol = 12 |
| 标准字体:Symbol。 | |
| static final int | e_StdIDTimes = 8 |
| 标准字体:Times-Roman。 | |
| static final int | e_StdIDTimesB = 9 |
| 标准字体:Times-Bold。 | |
| static final int | e_StdIDTimesBI = 10 |
| 标准字体:Times-BoldItalic。 | |
| static final int | e_StdIDTimesI = 11 |
| 标准字体:Times-Italic。 | |
| static final int | e_StdIDZapfDingbats = 13 |
| 标准字体:ZapfDingbats。 | |
| static final int | e_StyleAllCap = 0x10000 |
| 字体样式:全大写。 | |
| static final int | e_StyleFixedPitch = 0x0001 |
| 字体样式:等宽字体。 | |
| static final int | e_StyleItalic = 0x0040 |
| 字体样式:斜体。 | |
| static final int | e_StyleNonSymbolic = 0x0020 |
| 字体样式:非符号字体。 | |
| static final int | e_StylesBold = 0x40000 |
| 字体样式:强制粗体。 | |
| static final int | e_StyleScript = 0x0008 |
| 字体样式:手写字体。 | |
| static final int | e_StyleSerif = 0x0002 |
| 字体样式:衬线字体。 | |
| static final int | e_StylesSmallCap = 0x20000 |
| 字体样式:小型大写。 | |
| static final int | e_StyleSymbolic = 0x0004 |
| 字体样式:符号字体。 | |
在PDF文档中,字体用于在PDF页面中绘制文本。
此类表示在Foxit PDF SDK中使用的字体。此类为用户提供不同的构造函数来构造 新的字体对象,通过指定参数、标准字体ID或从字体文件路径。 字体对象也可以直接从PDF文档中的其他对象(如自由文本注释、 文本图形对象等)中检索。 此类还提供一些函数来获取字体的一些基本信息。
| com.foxit.sdk.common.Font.Font | ( | String | name, |
| int | styles, | ||
| int | charset, | ||
| int | weight | ||
| ) | throws com.foxit.sdk.PDFException |
带有给定属性的构造函数。
此函数用于基于系统字体构造字体。
| [in] | name | 要创建的字体的PostScript名称。 |
| [in] | styles | 字体样式。请参考从 com.foxit.sdk.common.Font.e_StyleFixedPitch 开始的值, 可以是这些值中的一个或组合。 |
| [in] | charset | 要创建的字体的字符集。请参考从 com.foxit.sdk.common.Font.e_CharsetANSI 开始的值,应该是这些值中的一个。 |
| [in] | weight | 原始字体粗细。0表示未指定。 |
| com.foxit.sdk.common.Font.Font | ( | int | font_id | ) | throws com.foxit.sdk.PDFException |
通过标准字体ID的构造函数。
| [in] | font_id | 要创建的字体的标准字体ID。请参考从 com.foxit.sdk.common.Font.e_StdIDCourier 开始的值,应该是这些值中的一个。 |
| com.foxit.sdk.common.Font.Font | ( | String | font_file_path, |
| int | face_index, | ||
| int | charset | ||
| ) | throws com.foxit.sdk.PDFException |
从字体文件的构造函数。
| [in] | font_file_path | 现有字体文件的完整路径。 |
| [in] | face_index | 基于零的字体面索引。有效范围:从0到(face_count-1)。 请调用系统函数获取face_count。 |
| [in] | charset | 要创建的字体的字符集。请参考从 com.foxit.sdk.common.Font.e_CharsetANSI 开始的值,应该是这些值中的一个。 |
| com.foxit.sdk.common.Font.Font | ( | StreamCallback | stream | ) | throws com.foxit.sdk.PDFException |
通过使用 com.foxit.sdk.common.fxcrt.StreamCallback 从字体流的构造函数。
| [in] | stream | 由用户实现的 com.foxit.sdk.common.fxcrt.StreamCallback 对象 用于读取字体文件内容。 |
| com.foxit.sdk.common.Font.Font | ( | Font | other | ) |
使用另一个字体对象的构造函数。
| [in] | other | 另一个字体对象。 |
| UInt32Array com.foxit.sdk.common.Font.addUnicodes | ( | PDFDoc | document, |
| UInt32Array | unicode_array | ||
| ) | throws com.foxit.sdk.PDFException |
向当前嵌入字体添加Unicode字符。
此函数仅支持新嵌入的字体。
| [in] | document | 有效的PDF文档对象。 |
| [in] | unicode_array | 要嵌入的Unicode数组。 |
| synchronized void com.foxit.sdk.common.Font.delete | ( | ) |
| Font com.foxit.sdk.common.Font.embed | ( | PDFDoc | document, |
| boolean | is_add_all_unicodes | ||
| ) | throws com.foxit.sdk.PDFException |
将当前字体嵌入到指定的PDF文档中。
| [in] | document | 有效的PDF文档对象。 |
| [in] | is_add_all_unicodes | 如果没有添加文档中的Unicode字符,是否将从0x0到0xFFFF的Unicode字符 添加到当前嵌入字体中。 true 表示嵌入从0x0到0xFFFF的Unicode字符, false 表示只嵌入一个Unicode字符。默认值:true。 用户可以通过 Font.addUnicodes 添加Unicode字符。 |
| int com.foxit.sdk.common.Font.getAscent | ( | ) | throws com.foxit.sdk.PDFException |
获取上升值,以1/1000 em大小为单位(PDF单位)。
| String com.foxit.sdk.common.Font.getBaseFontName | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取基础字体名称。
| [in] | document | 有效的PDF文档对象。 |
| RectI com.foxit.sdk.common.Font.getCharBBox | ( | int | unicode | ) | throws com.foxit.sdk.PDFException |
获取由Unicode指定的字符的边界框。
| [in] | unicode | 字符的Unicode值。 |
| RectI com.foxit.sdk.common.Font.getCharBBox | ( | int | unicode, |
| PDFDoc | document | ||
| ) | throws com.foxit.sdk.PDFException |
获取PDF文档中由Unicode指定的字符的边界框。
| [in] | unicode | 字符的Unicode值。 |
| [in] | document | 有效的PDF文档对象。 |
| float com.foxit.sdk.common.Font.getCharWidth | ( | int | unicode | ) | throws com.foxit.sdk.PDFException |
获取由Unicode指定的字符的宽度(以1/1000 em大小为单位(PDF单位))。
| [in] | unicode | 字符的Unicode值。 |
| float com.foxit.sdk.common.Font.getCharWidth | ( | int | unicode, |
| PDFDoc | document | ||
| ) | throws com.foxit.sdk.PDFException |
获取PDF文档中由Unicode指定的字符的宽度(以1/1000 em大小为单位,作为PDF单位)。
| [in] | unicode | 字符的Unicode值。 |
| [in] | document | 有效的PDF文档对象。 |
| int com.foxit.sdk.common.Font.getCIDCharset | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取CID字体字符集。
适用于基于CID的字体。对于其他类型的字体,将抛出异常 com.foxit.sdk.common.Constants.e_ErrUnsupported 。
| [in] | document | 有效的PDF文档对象。 |
| int com.foxit.sdk.common.Font.getDescent | ( | ) | throws com.foxit.sdk.PDFException |
获取下降值,以1/1000 em大小为单位(PDF单位)。
| String com.foxit.sdk.common.Font.getEncoding | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取当前字体编码。
| [in] | document | 有效的PDF文档对象。 |
| String com.foxit.sdk.common.Font.getFamilyName | ( | ) | throws com.foxit.sdk.PDFException |
检索字体族名称。
| int com.foxit.sdk.common.Font.getFontType | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取字体类型。
| [in] | document | 有效的PDF文档对象。 |
| String com.foxit.sdk.common.Font.getName | ( | ) | throws com.foxit.sdk.PDFException |
检索PostScript名称。
| int com.foxit.sdk.common.Font.getStandard14Font | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取标准字体ID。
适用于标准字体。对于其他类型的字体,将抛出异常 com.foxit.sdk.common.Constants.e_ErrUnsupported 。
| [in] | document | 有效的PDF文档对象。 |
| int com.foxit.sdk.common.Font.getStyles | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
获取字体样式。
| [in] | document | 有效的PDF文档对象。 |
| boolean com.foxit.sdk.common.Font.isBold | ( | ) | throws com.foxit.sdk.PDFException |
判断当前字体是否为粗体。
| boolean com.foxit.sdk.common.Font.isCharSupported | ( | int | unicode, |
| PDFDoc | document | ||
| ) | throws com.foxit.sdk.PDFException |
检查当前字体是否支持某字符。
| [in] | unicode | 字符unicode码。 |
| [in] | document | 文档对象,如果字体没有内嵌到文档中,这个参数是空对象。 |
| boolean com.foxit.sdk.common.Font.isEmbedded | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
判断当前字体是否嵌入在指定的PDF文档中。
| [in] | document | 有效的PDF文档对象。 |
| boolean com.foxit.sdk.common.Font.isEmpty | ( | ) |
检查当前对象是否为空。
当当前对象为空时,意味着当前对象无用。
| boolean com.foxit.sdk.common.Font.isItalic | ( | ) | throws com.foxit.sdk.PDFException |
判断当前字体对象是否为斜体。
| boolean com.foxit.sdk.common.Font.isStandardFont | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
检查当前字体是否为标准字体。
| [in] | document | 有效的PDF文档对象。 |
| boolean com.foxit.sdk.common.Font.isSupportEmbedded | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
检查当前字体是否支持嵌入到指定的PDF文档中。
| [in] | document | 有效的PDF文档对象。 |
| boolean com.foxit.sdk.common.Font.isVertWriting | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException |
检查当前字体是否为垂直书写。
| [in] | document | 有效的PDF文档对象。 |
| boolean com.foxit.sdk.common.Font.setEncoding | ( | PDFDoc | document, |
| String | value | ||
| ) | throws com.foxit.sdk.PDFException |
设置当前字体编码。
| [in] | document | 有效的PDF文档对象。 |
| [in] | value | 要设置的字体编码。有关编码值,请参考 <PDF reference 1.7>第442页中的"TABLE 5.15 Predefined CJK CMap names"。 此参数不应为空字符串。 |