we are currently using .ttf font, which works with aspose well. Now we need to use google noto fonts to support additaional regions. We put the font otf files to the same folder as those ttf files, for some reason, the font does not show up.
More specifically, we need to support rendering PDFs from doc/docx/pdf files that include east asian fonts (CJK).
We are trying to use the google noto-CJK fonts since these provide a complete character set for JP, KR, SC, TC. The google noto-CJK fonts are OTF fonts. These are found here - https://fonts.google.com/noto
Are there specific issues with installing OTF fonts? or east asian fonts?
Are there specific issues for enabling support of east asian characters?
Do you have any recommendations for east asian character support?
Thanks for your inquiry. I have downloaded the noto-CJK fonts and tested using Aspose.Pdf for Java 10.3.0. I am unable to notice any issue. Please download latest version of Aspose.Pdf for Java, hopefully it will resolve the issue. If issue persist then please share you sample code here. We will look into it and will guide you accordingly.
// open document
Document pdfDocument = new Document();
com.aspose.pdf.Page section = pdfDocument.getPages().add();
TextFragment t = new TextFragment("Sample Text in ABite OTF font");
// to find font in system font folder
t.getTextState().setFont(FontRepository.*findFont*("NotoSansCJKsc-Black"));
// to open a font with complete path
// t.getTextState().setFont(FontRepository.openFont("c:/windows/fonts/NotoSansCJKsc-Black.otf"));
t.getTextState().getFont().setEmbedded(true);
section.getParagraphs().add(t);
pdfDocument.save(*myDir* + "NotoSansCJKsc_out1.pdf");
Please feel freel to contact us for any further assistnace.
We are not specifying fonts in the code, instead, we just put fonts in a font folder. And it works well with .ttf file. But for some reason aspose does not recognize the google font files in the same folder.
Thanks for your inquiry. We will appreciate it if you please share some sample code here, so we will check it and provide you information. Moreover, please confirm your environment details as well.
The fonts are saved in “fonts” folder, from warning message, I see those fonts are used, but seems the document original font has different name, and the Chinese characters are still not showing up.
Just realized that legally we can’t use Windows fonts in linux environment.
Is it possible to use google noto fonts when we convert word document to PDF? Seems currently it will fail back to “Times New Roman”, unless we remove “Times New Roman” fonts from the fonts folder, which is not what we want.
For example, let’s say the Font name in word doc is something chinese ChineseSong, is it possible to let Aspose to use NotoCJKsc ?
Thanks a lot for your help. I know this is very tricky question.
*santi3santi3santi3:
Just realized that legally we can’t use Windows fonts in linux environment.
Is it possible to use google noto fonts when we convert word document to PDF? Seems currently it will fail back to “Times New Roman”, unless we remove “Times New Roman” fonts from the fonts folder, which is not what we want.
For example, let’s say the Font name in word doc is something chinese ChineseSong, is it possible to let Aspose to use NotoCJKsc ?
Thanks a lot for your help. I know this is very tricky question.*
Hi Jack,
Thanks for your feedback.
Your above stated query appears to be related to Aspose.Words, so I am moving this thread to respective forum, where my fellow workers from respective team will answer this query.
Thanks for your inquiry. When installed, Aspose.Words can correctly render Google Noto Fonts to PDF files.
Secondly, if the font used in source Word document is not installed on the machine you’re performing rendering to PDF, Aspose.Words will use some substitute font e.g. ‘Times New Roman’. But, you can change default font name using FontSettings.DefaultFontName property.
“When installed, Aspose.Words can correctly render Google Noto Fonts to PDF files.”
We are trying to convert word documents to PDF. The word document could contain various fonts, including east asian characters. Since we are on Linux, we are not allowed to use MS office fonts other than some very old ones. We have Noto fonts setup in fonts folder, which is referenced by font settings. But it appears Aspose will not be able to pick correct font groups, for example, if there is “Song Ti” in words, I would expect Aspose to choose Noto CJK sc font, but it does not, unless I remove all the other fonts in the font directory.
About default font settings, it does not work for us too, because there are a lot of possible fonts in the document, I am not able to find one single default font.
I have attached the sample project in this discussion.
Please note that Aspose.Words requires fonts when rendering documents to fixed-page formats such as PDF, XPS or SWF. So, you need to install all possible fonts that your customers might use in their Word documents on the Linux machine you’re performing conversion to PDF. Please check following article: https://docs.aspose.com/words/java/using-truetype-fonts/
In addition to default font locations, if you’re keeping some fonts in custom location, the following article describes how you should instruct Aspose.Words to look for fonts in system folders as well as a custom defined folder. https://docs.aspose.com/words/java/specify-truetype-fonts-location/
I am afraid, I don’t see any sample project attached in your last post to be able to reproduce your issue on our end. Please provide complete details and resources (source code, Word document and PDF file showing the undesired output) to investigate this scenario further on our end.
Unfortunately, Aspose does not provide technical support over the phone. Phone support is only available for sales and purchase questions.
I installed several fonts under fonts folder, including Noto Sans CJK TC, SC, JP, KR, as well as some free English fonts.
It appears sample application will not be able to map Chinese font from word to Noto CJK SC/TC. The only way I could do is to have words fonts be added to “./fonts” font, but that’s not allowed in linux environment.
I’d like to confirm I didn’t misunderstand the usage.
Unfortunately, at least some of those fonts are from Microsoft words, it is only free in windows/mac platform, but they are legally not allowed to be deployed to Unix/Linux environment, which is our production environment.
Thanks for your inquiry. Please try Liberation Fonts which are licensed under OFL and are an alternative to standard Windows fonts such as Arial, Times New Roman, and Courier New. It is by design that Aspose.Words has to use fonts during rendering and if required fonts are not present on the machine, I am afraid, there is no workaround except to install them.
Thanks for your inquiry. Please search on web and find some free alternates to those fonts. If we can help you with anything else, please feel free to ask.
Is there anyway to map microsoft fonts to some other equivalent fonts, such as Google Noto fonts? We are on Linux machine, do not have license to use Microsoft fonts.
I see both font sets are in “.ttf” format, I hope they are compatible.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.