Main Content

mlreportgen.ppt.FontSize Class

Namespace: mlreportgen.ppt

Description

Format that specifies the font size of text in a presentation.

The mlreportgen.ppt.FontSize class is a handle class.

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

fontSizeObj = mlreportgen.ppt.FontSize creates a 12-point font.

fontSizeObj = mlreportgen.ppt.FontSize(value) sets the Value property to the font size specified by value.

example

Properties

expand all

Font size, specified as a character vector or string scalar, formatted as a numeric value followed by a unit of measurement. For example, "12pt" specifies 12 points. Use one of the following abbreviations for the unit of measurement:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

Example: "12pt"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Tag, specified as a character vector or string scalar. The PPT API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The PPT API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

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

Create a paragraph and append text in a large font size.

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);

Add the paragraph to the slide.

replace(slide,"Content",p);

Close and view the presentation.

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.

Version History

Introduced in R2015b