Skip to content

Commit

Permalink
[7.3.3] Check oParagraph.SetFontFamily
Browse files Browse the repository at this point in the history
  • Loading branch information
askonev committed Feb 9, 2023
1 parent 0acda8c commit f33b42b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/docx/smoke/api_paragraph/set_font_family.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a paragraph with the font family set to ");
oParagraph.AddText('Consolas')
oParagraph.SetFontFamily("Consolas");
builder.SaveFile("docx", "SetFontFamily.docx");
builder.CloseFile();
6 changes: 6 additions & 0 deletions spec/docx/smoke/api_paragraph_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,10 @@
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/set_widow_control.js')
expect(docx.elements[5].orphan_control).to be_truthy
end

it 'ApiParagraph | SetFontFamily method' do
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/set_font_family.js')
expect(docx.elements[0].nonempty_runs[0].font).to eq(docx.elements[0].nonempty_runs[1].text)
end

end

0 comments on commit f33b42b

Please sign in to comment.