Font source

Hi,

for Word to PDF conversion, i have to maintain fonts within a java enterprise application. It works using the MemoryFontSource.
But now a have to include much more TTF fonts and this fills up the applications memory. Is it possible to load them via getResourceAsStream() when they are used.

@uqjp,

The following article will present you how to set Aspose.Words to look for TrueType fonts in system folders as well as a custom defined folder when scanning for fonts.

Specifying Fonts to be Read from both the System Fonts Folder and a Custom Folder

Thank you, but i need to read the fonts using the Classloader.

@uqjp,

You can try copying the Font file(s) in the resources folder of your project. Rebuilding the project should embed the Font file(s) into application’s .jar file. After that you can load the Font files into stream by using the following code:

Program.class.getResourceAsStream("font.ttf")

Hi,

thats what i do when using the MemoryFontSource. But i can’t load all available TTF files into memory. What i need is a ResourceFontSource (or an URLFontSource) similar to the FileFontSource.

Best regards
Joachim

@uqjp,

We have logged your requirements in our issue tracking system. The ID of your issue is WORDSNET-16739. Your thread has also been linked to this issue. We will inform you via this thread as soon as this issue is resolved.

Thank you!

Best regards
Joachim

The issues you have found earlier (filed as WORDSNET-16739) have been fixed in this Aspose.Words for .NET 19.5 update and this Aspose.Words for Java 19.5 update.