我想更改字体并将其样式设置为粗体。 我有两个问题:如何更改字体?
- 改变
CharWeight
作品,但不CharFontName
- ,它适用 “大胆”,以全款,不仅要选择
这里是我的代码:
sub AddAnimation
xTextCursor = ThisComponent.CurrentController.Selection(0)
xText = xTextCursor.getText()
xText.CharFontName = "Consolas"
xText.CharWeight = com.sun.star.awt.FontWeight.BOLD
end Sub
当前设置的字体名称是什么?尝试从空文档开始并创建一个文本块。 –