SetFontScheme
Sets the font scheme to the current presentation theme.
Syntax
expression.SetFontScheme(oApiFontScheme);
expression
- A variable that represents a ApiTheme class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
oApiFontScheme | Required | ApiThemeFontScheme | Theme font scheme. |
Returns
boolean
Example
This example sets the font scheme to the current presentation theme.
- Code
- Result
// How to get a theme and set a new font scheme.
// Create a new font scheme and apply it to the slide theme.
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
const fontScheme = Api.CreateThemeFontScheme("Arial", "Noto Sans Simplified Chinese", "Arabic", "Times New Roman", "Noto Serif Simplified Chinese", "Arabic", "New font scheme");
const theme = slide.GetTheme();
theme.SetFontScheme(fontScheme);
const fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, fill, stroke);
shape.SetPosition(608400, 1267200);
const docContent = shape.GetDocContent();
docContent.RemoveAllElements();
const paragraph = Api.CreateParagraph();
paragraph.SetJc("left");
paragraph.AddText("This is an example of a paragraph with a new font scheme set.");
docContent.Push(paragraph);
slide.AddObject(shape);