File tree Expand file tree Collapse file tree
js/docx/smoke/api_paragraph Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ( ) ;
Original file line number Diff line number Diff line change 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
262267end
You can’t perform that action at this time.
0 commit comments