FolderFontSource

FolderFontSource(string, bool)

向量.

public FolderFontSource(string folderPath, bool scanSubfolders)
范围类型描述
folderPathString文件夹路径。
scanSubfoldersBoolean确定是否扫描子文件夹。

例子

演示如何使用包含字体的本地系统文件夹作为字体源。

// 从包含字体文件的文件夹创建字体源。
FolderFontSource folderFontSource = new FolderFontSource(FontsDir, false, 1);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] {folderFontSource});

Assert.AreEqual(FontsDir, folderFontSource.FolderPath);
Assert.AreEqual(false, folderFontSource.ScanSubfolders);
Assert.AreEqual(FontSourceType.FontsFolder, folderFontSource.Type);
Assert.AreEqual(1, folderFontSource.Priority);

也可以看看


FolderFontSource(string, bool, int)

向量.

public FolderFontSource(string folderPath, bool scanSubfolders, int priority)
范围类型描述
folderPathString文件夹路径。
scanSubfoldersBoolean确定是否扫描子文件夹。
priorityInt32字体来源优先。请参阅Priority属性描述以获取更多信息。

例子

演示如何使用包含字体的本地系统文件夹作为字体源。

// 从包含字体文件的文件夹创建字体源。
FolderFontSource folderFontSource = new FolderFontSource(FontsDir, false, 1);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] {folderFontSource});

Assert.AreEqual(FontsDir, folderFontSource.FolderPath);
Assert.AreEqual(false, folderFontSource.ScanSubfolders);
Assert.AreEqual(FontSourceType.FontsFolder, folderFontSource.Type);
Assert.AreEqual(1, folderFontSource.Priority);

也可以看看