Hi @jan_blaha, as I have posted in the playground example, the font is not exactly the same with the font "Noto Sans" in Google Fonts.
And I finally find out that the '.woff2' font is not well supported, I changed to use '.ttf' font and it works fine.
liwonder
@liwonder
Posts made by liwonder
-
RE: How to use custom font ?
-
RE: How to use custom font ?
Hi @bjrmatos here is my example: https://playground.jsreport.net/studio/workspace/SyUrRILTg/1930
I added the woff2 font as asset but it seem that the font is not in use. The PDF is still uses the default font. -
RE: How to use custom font ?
^This is what I have in my 'assets' folder
This is how I use the fonts in my template.This works fine in my Mac, but the font won't render correctly in windows.
-
RE: How to use custom font ?
This is the directory tree of my project, the problem is I don't know how to add the font file as a assets. -
RE: How to use custom font ?
@bjrmatos Yes, I have read the guide, but still can't get my own font embedded in my project. I found that the tutorial about how to add the asset is using 'jsreport studio' as example, but I can't figure out a way how to add my font as asset in my local server.
-
How to use custom font ?
How to use custom font ?
I run jsreport in node.js , how can I embed custom font in my pdf?
-
RE: How to pass data with a 'function' as value to the template?
Thanks! I will look up the 'assets'.
-
RE: How to pass data with a 'function' as value to the template?
Thanks for your reply and that make sense! But now the situation I am facing is that I got ten or more children templates which will probably use this same function in the future, so I should copy and paste ten times, this is clearly not a good solution. If I want to make some changes with the function in the future, that would be a unwise move. Thanks!
-
How to pass data with a 'function' as value to the template?
Say I got some data in function beforeRender like this:
req.data.myData = {
name: 'test',
formatter: function(value) {
return '$' + value;
}
}How can I get the function pass into the template?