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).
Hi there,
//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);
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,
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
Hi 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.
Would you please post the new discussion URL here? I am not able to find the post in aspose word forum.
Kind Regards.
Hi,
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,
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,
- Calibri
- Cambria
- Times New Roman
- Adobe Devanagari
- Bangla Sangam MN
- Microsoft Sans Serif
- Microsoft Himalaya
- 黑体
- MS 明朝
- Webdings
- Desdemona
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 the information. I tried the liberation fonts, they do not support asian fonts.
Hi,
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.