SetFontFamily

function SetFontFamily(sFontFamily: string = null): ApiParagraph

Description

Sets all 4 font slots with the specified font family.

Parameters

sFontFamilystringdefault: null

The font family or families used for the current paragraph.

Returns

ApiParagraph

Try It

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

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).