Free Support Forum - aspose.com

How does aspose support google noto font?

Hello expert,

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.

Please advise, thanks
// Jack

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://www.google.com/get/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?

thx -
Brad (working with Jack)

Hi there,


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<o:p></o:p>

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.

Best Regards,

Hello Tilal,

Thank you very for the helping.

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.

Any suggestion?

Thanks.

// Jack

Hi Jack,


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.

Best Regards,

Hello Tilal,

Sorry for replying that late. I was in other priority, just moved back to this problem.

This is my sample code:

FontSettings.setFontsFolder(
“fonts/”,
false);
Document doc = new Document(“asianFonts.docx”);
PdfSaveOptions saveOptions = new PdfSaveOptions();

doc.save(“asianFonts.pdf”, saveOptions);

I am using NotoSansCJKjp, kr, tc, and sc fonts from
https://www.google.com/get/noto/

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.

asianFonts.docx are attached.




// Jack

Figured out. After I copied font files from mac, it works now.

Thanks.

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.

// Jack


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.


Would you please post the new discussion URL here? I am not able to find the post in aspose word forum.

Kind Regards.

Hi,


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.

I hope, this helps.

Best regards,

Hi Awais,

I need more explanation on this statement:

"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.

Would you mind to have a phone conversation?

Thanks.


Hi,


Thanks for the details.

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:
http://www.aspose.com/docs/display/wordsjava/How+Aspose.Words+Uses+True+Type+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.
http://www.aspose.com/docs/display/wordsjava/How+to++Specify+True+Type+Fonts+Location

Regarding installing fonts on Linux machine, please check the following article:
http://www.aspose.com/docs/display/wordsjava/How+to++Install+True+Type+Fonts+on+Linux

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.

Best regards,

Hi Awais,

Thanks for the detail information.

I am sorry for missing the attachment, let me attach again.

Since noto fonts too big, I didn’t include them in the zip file. They could be downloaded from

https://www.google.com/get/noto/

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.

Thank you very much again!






Hi,


Thanks for your inquiry. Please make sure that your custom fonts folder contain the following fonts:

  • Calibri
  • Cambria
  • Times New Roman
  • Adobe Devanagari
  • Bangla Sangam MN
  • Microsoft Sans Serif
  • Microsoft Himalaya
  • 黑体
  • MS 明朝
  • Webdings
  • Desdemona

Please also use the code from last example here:
http://www.aspose.com/docs/display/wordsjava/How+to++Specify+True+Type+Fonts+Location

Best regards,

Thanks for the information.

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.

That’s why I opened this question.

Thanks

Hi,


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.

Best regards,

Thanks for the information. I tried the liberation fonts, they do not support asian fonts.


Hi,


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.

Best regards,

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.

Thanks a lot.