考虑下面的代码片段。当我将这段文字打印到一个word文档中时,我所有的“a”字符都会得到默认的字体“杯(主体)”,而其余的文本则会得到我选择的字体“本世纪”。为什么要让OpenXml接受一般的非英语字符,或者是特定语言中的非英语字符呢?
//Creation of Documents and a paragraph to work with
var runFontCentury = new RunFonts { Ascii = "Century" };
var size12 = new FontSize { Val = new StringValue("24") };
Run run = new Run()
run.AppendChild(new Text("non-english åäö"));
//Appending to paragraph and printing out as a word document发布于 2021-03-06 16:18:31
这是一个重复的this问题。
解决方案就是添加更多的字符集。大多数(如果不是全部)欧洲字符可以在HighAnsi字符集中找到。我还增加了一套好的措施。
因此,解决办法:
var runFontCentury = new RunFonts { Ascii = "Century", HighAnsi = "Century", ComplexScript = "Century", };https://stackoverflow.com/questions/66507069
复制相似问题