Hey,
Hi! I try to add a Google Font to my reports but the generated PDF doesn’t use the custom font. The preview is looking good but the generated PDF only contains the default font.
Any ideas what I can do? I use the following code:
Hey,
Hi! I try to add a Google Font to my reports but the generated PDF doesn’t use the custom font. The preview is looking good but the generated PDF only contains the default font.
Any ideas what I can do? I use the following code:
Hey @gus
Welcome to the MainWP community.
Your code might have been blocked by our forum software for security reasons.
Can you upload it to a site such as pastebin.com?
ok, and how do you see the code in pastebin? I never used it before <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconne - Pastebin.com
Unfortunately, custom fonts cannot be loaded and used in that manner.
The idea is to place the custom fonts on the Dashboard site (/wp-content/uploads/mainwp_pro_reports/fonts) and then to use absolute URL when loading them via @font-face.
Make sure there isn’t a htaccess file in the /wp-content/uploads/mainwp_pro_reports/fonts folder, otherwise loading of fonts might be blocked.
Note that in the example below, we are using two .ttf files for regular and bold. You don’t necessarily need to use different font weights, but if you do, they have to be loaded as separate fonts like in the example below.
Example code: proreports - Pastebin.com
Thanks for your response, I’m going to try that way and tell you if it works.