我想更改字体并将其样式设置为粗体。我有两个问题:
- 改变
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