Hindi fonts in pdf
-
Hi Team,
Hindi fonts are not rendered correctly in Phantom-pdf or Chrome-Pdf.
Please have a look at the below link.
https://playground.jsreport.net/w/anon/C5YW2A9uThanks in advance.
-Vaibhav Jain
-
Yes, such font needs to be installed on the particular linux server. Windows have this pre-installed.
Or you can try to download a webfont from the internet and use it through an asset.
Take a look on this blog post
https://jsreport.net/blog/fonts-in-pdf
-
Hi Jan,
Thanks for your reply.
I tried using google fonts https://fonts.google.com/specimen/Sarala in the jsreport. I got it working in the JSreport playground
https://playground.jsreport.net/w/anon/r7VHIsX0
However, the same is not working in production.
https://aarfid.jsreportonline.net/studio/templates/HyRdyxsWN-Vaibhav Jain
-
I was able to make it work by doing this.
Look into your linked web font
https://fonts.googleapis.com/css?family=Sarala&subset=devanagariThere I see url to woff2
https://fonts.gstatic.com/s/sarala/v2/uK_y4riEZv4o1w9hDBcSAv4.woff2Download and rename it.
Upload it as an asset to jsreportonline.
Use copy button to get the embedding code and paste it to the template.In the end it looks like this.
<html> <head> <style> @font-face { font-family: 'Sarala'; src: url({#asset Sarala.woff2 @encoding=dataURI}); format('woff2'); } </style> <style> * { font-family: Sarala; } </style> </head> <body> यह निबंध बहु </body> </html>