mlreportgen.ppt.FontSize class

Package: 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 (MATLAB).

Creation

Description

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

example

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

Properties

expand all

ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated 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.

Specifying your own tag value can help you to identify where an issue occurred during presentation generation.

Font size, specified as a character vector or string scalar, formatted as a numeric value followed by a unit of measurement. For example, '5in' specifies 5 inches. Use one of the following abbreviations for the unit of measurement:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

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

Introduced in R2015b