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

Free Support Forum - aspose.com

Aspose.Words for Java does not detect System fonts on Windows 10

We are using java aspose and running aspose in Windows 10:

I have installed a new font on Windows 10.
Then I’ve created a word document which uses that font.
When saving as pdf with Aspose the font is ignored.
If I add the font file to the document settings font sources, then it works fine.

I don’t know why the font is available in Word but not in aspose?
Here is my code:

                String docname="C:\\barcode.docx";
		Document doc = new Document(docname);
		// Create a font settings object for our document
		doc.setFontSettings(new FontSettings());
		SystemFontSource systemFontSource = (SystemFontSource) 
                doc.getFontSettings().getFontsSources()[0];
		
		

		// Create a font source from a file in our system
		FileFontSource fileFontSource = new FileFontSource("C:\\usps4cb.ttf", 0);

		// Import the font source into our document
		//doc.getFontSettings().setFontsSources(new FontSourceBase[]{systemFontSource, fileFontSource});
		doc.save("C:\\barcode.pdf");

@vecin2

Please ZIP and attach your input Word document along with font ‘usps4cb.ttf’ here for testing. We will investigate the issue and provide you more information on it.