Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openoffice impress 如何更改字体?_Openoffice Impress_Libreoffice Impress_Libreoffice Macros - Fatal编程技术网

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
起作用,则这一定不是问题所在


还有一个猜测:可能是样式覆盖了它。

当前设置的字体名称是什么?尝试从一个空文档开始创建一个文本块。然后如何更改样式?转到侧边栏中的“样式和格式”以查看是否存在问题。很明显,相关的样式被调用了。源代码太乱了,我已经放弃了,谢谢你的回答!