SetOutLine
设置当前文本块的文本轮廓。
语法
expression.SetOutLine(oStroke);
expression - 表示 ApiTextPr 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| oStroke | 必需 | ApiStroke | 用于创建文本轮廓的笔画。 |
返回值
示例
在文档中为装饰性文本添加彩色轮廓。
// How do I put a visible border around large styled text in a document?
// Give artistic text a distinct edge by applying a stroke outline in a document.
let doc = Api.GetDocument();
let textPr = Api.CreateTextPr();
textPr.SetFontSize(30);
textPr.SetBold(true);
textPr.SetCaps(true);
textPr.SetOutLine(Api.CreateStroke(0.2 * 36000, Api.CreateSolidFill(Api.RGB(51, 51, 51))));
textPr.SetTextFill(Api.CreateSolidFill(Api.RGB(255, 111, 61)));
textPr.SetFontFamily("Comic Sans MS");
let textArt = Api.CreateWordArt(textPr, "onlyoffice", "textArchUp", null, null, 0, 150 * 36000, 50 * 36000);
let paragraph = doc.GetElement(0);
paragraph.AddDrawing(textArt);