Openoffice impress 如何更改字体?
我想更改字体并将其样式设置为粗体。 我有两个问题:Openoffice impress 如何更改字体?,openoffice-impress,libreoffice-impress,libreoffice-macros,Openoffice Impress,Libreoffice Impress,Libreoffice Macros,我想更改字体并将其样式设置为粗体。 我有两个问题: 更改CharWeight有效,但无法更改CharFontName 它将“粗体”应用于整个段落,而不仅仅是选择 这是我的密码: sub AddAnimation xTextCursor = ThisComponent.CurrentController.Selection(0) xText = xTextCursor.getText() xText.CharFontName = "Consolas" xText
- 更改
有效,但无法更改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
调用getText()
获取整个文本,而不仅仅是所选部分
subchangefont
xTextCursor=ThisComponent.CurrentController.Selection(0)
xTextCursor.CharFontName=“控制台”
xTextCursor.CharWeight=com.sun.star.awt.fontwweight.BOLD
端接头
当我尝试使用LO和AOO时,字体名称发生了变化
你在使用脚本吗?如果是这样,那么它需要是CharFontNameComplex
或CharFontNameAsian
。但是,如果CharWeight
起作用,则这一定不是问题所在
还有一个猜测:可能是样式覆盖了它。当前设置的字体名称是什么?尝试从一个空文档开始创建一个文本块。然后如何更改样式?转到侧边栏中的“样式和格式”以查看是否存在问题。很明显,相关的样式被调用了。源代码太乱了,我已经放弃了,谢谢你的回答!