I try to setFontFamily("Arial")
to XWPFRun object with setText("Привет Hello")
- cyrillic a english. English text will become Arial after this method call, but Russian text will be still at Colibri font family. How to create right font family for cyrillic text?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Comment to setFontFamily()
says:
Specifies the fonts which shall be used to display the text contents of this run. Specifies a font which shall be used to format all characters in the ASCII range (0 - 127) within the parent run
To other char try use CTFonts.setHAnsi
, for example myXWPFRun.getCTR().getRPr().getRFonts().setHAnsi("Arial");
See bug https://issues.apache.org/bugzilla/show_bug.cgi?id=47148