主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

mlreportgen.ppt.FontSize 类

命名空间: mlreportgen.ppt

字体大小

描述

指定演示文稿中文本的字体大小的格式。

mlreportgen.ppt.FontSize 类是一个 handle 类。

类属性

HandleCompatible
true
ConstructOnLoad
true

有关类属性的信息,请参阅类属性

创建对象

描述

fontSizeObj = mlreportgen.ppt.FontSize 创建一个 12 磅的字体。

fontSizeObj = mlreportgen.ppt.FontSize(value)Value 属性设置为 value 指定的字体大小。

示例

属性

全部展开

字体大小,指定为字符向量或字符串标量,格式化为数值后跟测量单位。例如,“12pt”表示 12 磅。使用下列缩写之一作为测量单位:

  • "px" - 像素

  • "cm" - 厘米

  • "in" - 英寸

  • "mm" - 毫米

  • "pc" - 派卡

  • "pt" - 磅

示例: "12pt"

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

标记,指定为字符向量或字符串标量。PPT API 在创建此对象的过程中生成一个会话唯一标记。生成的标记形式为 CLASS:ID,其中 CLASS 是对象类,ID 是对象的 Id 属性的值。使用此值来帮助确定在文档生成过程中出现的问题的位置。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

目标标识符,指定为字符向量或字符串标量。PPT API 在创建文档元素对象时会生成一个会话唯一标识符。您可以为 Id 指定自己的值。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

示例

全部折叠

创建演示文稿。

import mlreportgen.ppt.*

ppt = Presentation("myFontSizePresentation.pptx");
open(ppt);
slide = add(ppt,"Title and Content");

创建一个段落并以大字体追加文本。

p = Paragraph();

tWarning = Text("WARNING:");
tWarning.Style = {FontSize("40pt"),Bold(true),FontColor("red")};
append(p,tWarning);

tDesc = Text(" Unplug the machine before doing the next steps.");
append(p,tDesc);

将该段落添加到幻灯片中。

replace(slide,"Content",p);

关闭并查看演示文稿。

close(ppt);
rptview(ppt);

Sample slide with the text "WARNING: Unplug the machine before doing the next steps." The word WARNING is capitalized and displays in red, as well as larger than the other body text.

版本历史记录

在 R2015b 中推出