Skip to content

Commit f33b42b

Browse files
committed
[7.3.3] Check oParagraph.SetFontFamily
1 parent 0acda8c commit f33b42b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
builder.CreateFile("docx");
2+
var oDocument = Api.GetDocument();
3+
var oParagraph = oDocument.GetElement(0);
4+
oParagraph.AddText("This is a paragraph with the font family set to ");
5+
oParagraph.AddText('Consolas')
6+
oParagraph.SetFontFamily("Consolas");
7+
builder.SaveFile("docx", "SetFontFamily.docx");
8+
builder.CloseFile();

spec/docx/smoke/api_paragraph_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,10 @@
259259
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/set_widow_control.js')
260260
expect(docx.elements[5].orphan_control).to be_truthy
261261
end
262+
263+
it 'ApiParagraph | SetFontFamily method' do
264+
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/set_font_family.js')
265+
expect(docx.elements[0].nonempty_runs[0].font).to eq(docx.elements[0].nonempty_runs[1].text)
266+
end
267+
262268
end

0 commit comments

Comments
 (0)