有没有办法将 Font 和 FontSize 设置应用于编号列表? 有 2 种方法可以将此设置设置为列表文本:
document.InsertList( numberedList, .Font(new Xceed.Words.NET.Font("Cambria"), 15 );
numberedList.Items[2].Font(new Xceed.Words.NET.Font("Cambria"));
另外:文档的默认字体 - 将在 v1.5 中通过新方法提供:Document.SetDefaultFont。(GitHub)
简短的回答是:
It can't be done with the current version of xceed
我在github上向xceedsoftware/docx提交了票并问了这个问题:
我了解如何创建编号列表:
using (DocX document = DocX.Create(ListSample.ListSampleOutputDirectory + @"AddList.docx"))
{
var numberedList = document.AddList("Berries", 0, ListItemType.Numbered, 1);
.
.
}
但是,如何修改数字的字体和/或字体大小?我懂了 调试器中的 ParagraphNumberProperties 属性但没有看到 DocX 类文档中任何有帮助的内容
澄清一下,我想修改字体和字体大小 列表中的数字,而不是数字右侧的文本。
他们的回复如下(即,您无法使用当前版本更改数字的字体)
嗨,
谢谢您的建议。
目前只能设置ListItems的字体/字体大小 Document.InsertList(列表列表,字体fontFamily,双fontSize) 方法。我们将研究添加此功能。
谢谢你。
Xceed.Document.NET.Formatting f = new Xceed.Document.NET.Formatting();
f.FontFamily = new Font("Times New Roman"); f.尺寸=11d; var numberedList = document.AddList("", 0, ListItemType.Numbered, 1, 格式: f);