HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › Free CJK Fonts
- This topic has 7 replies, 3 voices, and was last updated Sep 06, 2017
20:21:56 by ParagSagar.
-
AuthorPosts
-
April 24, 2017 at 18:11#27147
Hi,
I have a requirement to create PDF in Chinese Japanese and Korean (CJK) Language also apart from other non-multi byte languages.
Our development server are mac/windows and production server could be any type of server like WIN/UNIX/LINUX/AIX or AWS/AZURE.
Currently I am need of free CJK fonts i can use as a JAR deployment file.
I tried following steps in TTF embededding pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html with some converted NOTO ttf fonts, but I was not successful.
NOTO fonts from google are available in OTF. Is there any way i can use OTF fonts instead?
Or if i can get free CJK fonts in bundled JAR , so i can deoploy in my Web APP directly.
Thanks In Advance.
May 2, 2017 at 11:01#30046You may use free FontForge tool to convert OTF to TTF.
If you familiar with Python programming, you may also use the simple script
https://github.com/fonttools/fonttools/blob/master/Snippets/otf2ttf.pyJuly 31, 2017 at 23:52#30050Hi,
I have downloaded NOTO CJK OTF fonts (https://www.google.com/get/noto/help/cjk/) and converted into TTF from https://convertio.co/.
But when i was using the following command the pd4fonts.properties was not generating any entries for the fonts.
==== Mac cmd prompt out put start ==================
sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$> pwd
/cawork/pdf/pdffontsagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$> ls /fonts
NotoSansCJKjp-Black.ttf NotoSansCJKkr-Bold.ttf NotoSansCJKsc-DemiLight.ttf NotoSansMonoCJKjp-Regular.ttf
NotoSansCJKjp-Bold.ttf NotoSansCJKkr-DemiLight.ttf NotoSansCJKtc-Black.ttf NotoSansMonoCJKkr-Bold.ttf
NotoSansCJKjp-DemiLight.ttf NotoSansCJKkr-Light.ttf NotoSansCJKtc-Bold.ttf NotoSansMonoCJKkr-Regular.ttf
NotoSansCJKjp-Light.ttf NotoSansCJKkr-Medium.ttf NotoSansCJKtc-DemiLight.ttf NotoSansMonoCJKsc-Bold.ttf
NotoSansCJKjp-Medium.ttf NotoSansCJKkr-Regular.ttf NotoSansCJKtc-Light.ttf NotoSansMonoCJKsc-Regular.ttf
NotoSansCJKjp-Regular.ttf NotoSansCJKkr-Thin.ttf NotoSansCJKtc-Medium.ttf NotoSansMonoCJKtc-Bold.ttf
NotoSansCJKjp-Thin.ttf NotoSansCJKsc-Black.ttf NotoSansCJKtc-Thin.ttf NotoSansMonoCJKtc-Regular.ttf
NotoSansCJKkr-Black.ttf NotoSansCJKsc-Bold.ttf NotoSansMonoCJKjp-Bold.ttf pd4fonts.properties
sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffontbash-$> java -jar pd4ml.jar -configure.fonts /cawork/pdf/pdffont/fonts/
bash-$> cat fonts/pd4fonts.properties
#this is an autogenerated file. please remove manually any references to copyrighted fonts
#Mon Jul 31 15:35:50 PDT 2017sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$>
==== Mac cmd prompt out put ends ==================August 11, 2017 at 19:09#30051Hi,
I have downloaded NOTO CJK OTF fonts (https://www.google.com/get/noto/help/cjk/) and converted into TTF from https://convertio.co/.
But when i was using the following command the pd4fonts.properties was not generating any entries for the fonts.
==== Mac cmd prompt out put start ==================
sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$> pwd
/cawork/pdf/pdffontsagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$> ls /fonts
NotoSansCJKjp-Black.ttf NotoSansCJKkr-Bold.ttf NotoSansCJKsc-DemiLight.ttf NotoSansMonoCJKjp-Regular.ttf
NotoSansCJKjp-Bold.ttf NotoSansCJKkr-DemiLight.ttf NotoSansCJKtc-Black.ttf NotoSansMonoCJKkr-Bold.ttf
NotoSansCJKjp-DemiLight.ttf NotoSansCJKkr-Light.ttf NotoSansCJKtc-Bold.ttf NotoSansMonoCJKkr-Regular.ttf
NotoSansCJKjp-Light.ttf NotoSansCJKkr-Medium.ttf NotoSansCJKtc-DemiLight.ttf NotoSansMonoCJKsc-Bold.ttf
NotoSansCJKjp-Medium.ttf NotoSansCJKkr-Regular.ttf NotoSansCJKtc-Light.ttf NotoSansMonoCJKsc-Regular.ttf
NotoSansCJKjp-Regular.ttf NotoSansCJKkr-Thin.ttf NotoSansCJKtc-Medium.ttf NotoSansMonoCJKtc-Bold.ttf
NotoSansCJKjp-Thin.ttf NotoSansCJKsc-Black.ttf NotoSansCJKtc-Thin.ttf NotoSansMonoCJKtc-Regular.ttf
NotoSansCJKkr-Black.ttf NotoSansCJKsc-Bold.ttf NotoSansMonoCJKjp-Bold.ttf pd4fonts.properties
sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffontbash-$> java -jar pd4ml.jar -configure.fonts /cawork/pdf/pdffont/fonts/
bash-$> cat fonts/pd4fonts.properties
#this is an autogenerated file. please remove manually any references to copyrighted fonts
#Mon Jul 31 15:35:50 PDT 2017sagar3mac1221:sagar:clarity trunk:/cawork/pdf/pdffont
bash-$>
==== Mac cmd prompt out put ends ==================Question 1: Why the -configure.fonts utility is not working with the noto ttf fonts and not generating pd4fonts.properties
Question 2: Is there anyway I can get some DEBUG information while running -configure.fonts utility.
Questions 3: Eventually, i need a JAR file which I can place in my app lib folder to load these fonts for PD4ML, Can i just get a jar file with CJK font i can directly use in my java code to generate PDF ?
Question 4: Assuming , somehow get the noto jar with ttf embedding , what should be the right replacement for the java method arguments?
pd4ml.setDefaultTTFs(“Times New Roman”, “Arial”, “Courier New”); // currentpd4ml.setDefaultTTFs(“NotoSansCJK”, “Arial”, “Courier New”); //Proposed??
Please let me know if you need any more information.
Thanks,
Parag SagarAugust 11, 2017 at 19:11September 6, 2017 at 08:19#30047If the fonts are not listed in the .properties file, it seems they are still not in a compatible format. Did you try to convert them with a mentioned above Python script?
Q2 more debug info will be available in forthcoming PD4ML v4
Q3, Q4 it is possible. http://pd4ml.com/examples.zip contains chinese_ttf sample, which illustrates how to do that.See also http://pd4ml.com/cookbook/pd4ml_pdf_true_type_fonts.htm
September 6, 2017 at 17:26#30048following link does not work
http://pd4ml.com/examples.zipPage is throwing Error
No such file: /examples.zip
September 6, 2017 at 20:21#30049The correct link: http://pd4ml.com/examples.2017.05.zip
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.