Unexpected result when setting font

My code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setName("Windings 2");
builder.write("\u0052");
builder.write("\u00A3");
doc.save("D:\tmp\test.docx");

The result is attached.
The font shows fine as “Windings 2” in the font menu, but the document still displays in “Times New Roman” the “Normal”
When outputting as PDF the font is also not changed.

I use library 16.1.0

Hi there,

Thanks for your inquiry. Please set font name as “Wingdings 2” in your code. We have attached output documents with this post for your kind reference.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setName("Wingdings 2");
builder.write("\u0052");
builder.write("\u00A3");
doc.save(MyDir + "Out.docx");
doc.save(MyDir + "Out.pdf");