I am trying to use a custom font folder, but it does not seem to work as expected. I am using Java and my OS is Windows 7.
Steps to reproduce:
- copy Arial Unicode MS from C:\Windows\Fonts to C:\CustomFonts
- delete Arial Unicode MS from C:\Windows\Fonts
- run the following code snippet:
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(“Blank.pdf”);
com.aspose.pdf.Table table = new com.aspose.pdf.Table();
Note that the “竤” character is not shown correctly in the PDF. I would have expected that the font file is found and used from the “C:\CustomFonts” location (if I re-install the deleted font, it is recognized and used from the C:\Windows\Fonts folder).
I am using:
aspose-cells - 9.0.0
aspose-pdf - 11.8.0
I also tried older versions of aspose-cells with the following code snippets
but it also does not work as expected.
Am I doing something wrong?
String path = “E:/Data/Fonts/”;<o:p></o:p>
List fontPaths = com.aspose.pdf.Document.getLocalFontPaths();
However you can also use a font directly from a file path as following
Please feel free to contact us for any further assistance.
Works like a charm. Thank you,
I am using aspose.pdf-21.6.jar. How to set up customs fonts folder. I cannot see anything in the API. I want to run the API on Ubuntu
You can please use FontRepository.setLocalFontPaths(“fontPaths”); method offered by the API to set the custom font folder path. The required method was moved under
FontRepository Class in higher/latest version(s).
Thanks… I upload microsoft fonts under /usr/share/fonts
Now i am able to get the required output. There are no more error related to Fonts. However, i still need to compare the fonts
Can you please elaborate on why and how you need to compare fonts? Please share a bit more details so that we can check related information at our end and share it with you.
I am still experiencing some issue with performance. CPU Utilization is high. Is there any mechanism by which i can increase the performance. Can we configure to use multi threading?
You can please try increasing the Java Heap Size. Also, you can surely use the API in multi-threading environment. However, please note that Aspose.PDF is a multi-threaded safe API which means you will not face any issue until one document is accessed only by one thread at a time.