Get Started
Usage API
More information

SetFontFamily

SetFontFamily(sFontFamily) → { ApiParagraph | false }

Sets all 4 font slots with the specified font family.

Parameters:

Name Type Description
sFontFamily string

The font family or families used for the current paragraph.

Returns:

Type
ApiParagraph | false

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a paragraph with the font family set to 'Consolas'.");
oParagraph.SetFontFamily("Consolas");
builder.SaveFile("docx", "SetFontFamily.docx");
builder.CloseFile();

Resulting document