FontSettings

遗产: java.lang.Object

public class FontSettings

指定文档的字体设置。

要了解更多信息,请访问Working with Fonts文档文章。

Aspose.Words 使用字体设置来解析文档中的字体。字体主要在构建文档布局或呈现为固定页面格式时解析。但是在加载某些格式时,Aspose.Words 也可能需要解析字体。例如,在加载 HTML 文档时,Aspose.Words 可能会解析字体以执行字体回退。所以建议大家在字体设置里LoadOptions加载文档时。或者至少在构建布局或将文档呈现为固定页面格式之前。

默认情况下,所有文档都使用单个静态字体设置实例。它可以通过getDefaultInstance()财产。

随时从任何线程更改字体设置都是安全的。但建议您在处理某些使用此设置的文档时不要更改字体设置。这可能会导致相同的字体在文档的不同部分以不同的方式解析。

构造器

构造函数描述
FontSettings()初始化此类的新实例。

方法

方法描述
equals(Object arg0)
getClass()
getDefaultInstance()静态默认字体设置。
getFallbackSettings()与字体回退机制相关的设置。
getFontsSources()获取数组的副本,其中包含 Aspose.Words 查找 TrueType 字体的源列表。
getSubstitutionSettings()与字体替换机制相关的设置。
hashCode()
notify()
notifyAll()
resetFontSources()将字体源重置为系统默认值。
saveSearchCache(OutputStream outputStream)
setFontsFolder(String fontFolder, boolean recursive)设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的文件夹。
setFontsFolders(String[] fontsFolders, boolean recursive)设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的文件夹。
setFontsSources(FontSourceBase[] sources)设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的来源。
setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream)
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

FontSettings()

public FontSettings()

初始化此类的新实例。

equals(Object arg0)

public boolean equals(Object arg0)

参数:

范围类型描述
arg0java.lang.Object

退货: 布尔值

getClass()

public final native Class<?> getClass()

退货: java.lang.Class

getDefaultInstance()

public static FontSettings getDefaultInstance()

静态默认字体设置。默认情况下,此实例在文档中使用,除非Document.getFontSettings() / Document.setFontSettings(com.aspose.words.FontSettings)被指定。

退货: FontSettings - 相应的FontSettings价值。

getFallbackSettings()

public FontFallbackSettings getFallbackSettings()

与字体回退机制相关的设置。

退货: FontFallbackSettings - 相应的FontFallbackSettings价值。

getFontsSources()

public FontSourceBase[] getFontsSources()

获取数组的副本,其中包含 Aspose.Words 查找 TrueType 字体的源列表。

返回值是 Aspose.Words 使用的数据的副本。如果您更改返回数组中的条目,它将不会影响文档呈现。要指定新字体源,请使用setFontsSources(com.aspose.words.FontSourceBase[])方法。

退货: com.aspose.words.FontSourceBase[] - 当前字体源的副本。

getSubstitutionSettings()

public FontSubstitutionSettings getSubstitutionSettings()

与字体替换机制相关的设置。

退货: FontSubstitutionSettings - 相应的FontSubstitutionSettings价值。

hashCode()

public native int hashCode()

退货: 整数

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

resetFontSources()

public void resetFontSources()

将字体源重置为系统默认值。

saveSearchCache(OutputStream outputStream)

public void saveSearchCache(OutputStream outputStream)

参数:

范围类型描述
outputStreamjava.io.OutputStream

setFontsFolder(String fontFolder, boolean recursive)

public void setFontsFolder(String fontFolder, boolean recursive)

设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的文件夹。这是一个快捷方式setFontsFolders(java.lang.String[], boolean)仅设置一个字体目录。

参数:

范围类型描述
fontFolderjava.lang.String包含 TrueType 字体的文件夹。
recursivebooleanTrue 以递归方式扫描指定文件夹中的字体。

setFontsFolders(String[] fontsFolders, boolean recursive)

public void setFontsFolders(String[] fontsFolders, boolean recursive)

设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的文件夹。

默认情况下,Aspose.Words 会查找安装到系统中的字体。

设置此属性会重置所有以前加载的字体的缓存。

参数:

范围类型描述
fontsFoldersjava.lang.String[]包含 TrueType 字体的文件夹数组。
recursivebooleanTrue 以递归方式扫描指定文件夹中的字体。

setFontsSources(FontSourceBase[] sources)

public void setFontsSources(FontSourceBase[] sources)

设置 Aspose.Words 在渲染文档或嵌入字体时查找 TrueType 字体的来源。

默认情况下,Aspose.Words 会查找安装到系统中的字体。

设置此属性会重置所有以前加载的字体的缓存。

参数:

范围类型描述
sourcesFontSourceBase[]包含 TrueType 字体的源数组。

setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream)

public void setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream)

参数:

范围类型描述
sourcesFontSourceBase[]
cacheInputStreamjava.io.InputStream

toString()

public String toString()

退货: java.lang.字符串

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

参数:

范围类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

参数:

范围类型描述
arg0long
arg1int