SetFontFamily
Set 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");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a paragraph with the font family set to 'Calibri Light'.");
oParagraph.SetFontFamily("Calibri Light");
builder.SaveFile("docx", "SetFontFamily.docx");
builder.CloseFile();