We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

15.12.0: 'Times New Roman' font getting added to docx randomly

I am evaluating Aspose.Words. I wan’t do disallow font substitution for my .docx, which should work fine via ‘IWarningCallback’. However, just creating an empty .docx and adding a sentence in ‘Calibri’, aspose now complains that it has to replace ‘Times New Roman’, which isn’t to be found anywhere in the document!



Just run this code against the document I attached:



final Document document = new Document("/your/path/to/test.docx");

FontSettings.setFontsFolder("/your/path/to/fonts", false);

document.accept(new DocumentVisitor() {

@Override

public int visitRun(final Run run) throws Exception {

System.out.println(run.getFont().getName() + “:” + run.getText());

return super.visitRun(run);

}

});

document.setWarningCallback(new IWarningCallback() {

@Override

public void warning(final WarningInfo warningInfo) {

System.out.println(warningInfo.getDescription());

}

});

PdfSaveOptions saveOptions = new PdfSaveOptions();

document.save("/your/path/to/testx.pdf", saveOptions);



(/your/path/to/fonts) should contain Calibri or be empty. If Calibri is present, this is the outcome of above program:



Calibri:Evaluation Only. Created with Aspose.Words. Copyright 2003-2015 Aspose Pty Ltd.

Calibri:This text is in calibiri!

Font ‘Times New Roman’ has not been found. Using ‘Calibri’ font instead.



There is no ‘Times New Roman’ used in test.docx!



Thank you for your help.

Hi Ranchler,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12955. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-12955) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.