Dubas Google Fonts Extension¶
General Information¶
Dubas Google Fonts is an extension that will let you to use most popular fonts from Google Fonts inside your PDF's templates. This will allow you to beautify your PDF documents. Extension is really easy to use. Just have to install it and then, after rebuild, you'll see new fonts in PDF Template creator.
Info
There is a product page for this extension: devcrm.it/google-fonts
Requirements¶
- EspoCRM in version 6.1.0 or higher.
- PHP in version 7.3 or higher.
Available fonts¶
- Exo
- Lato
- Montserrat
- Open Sans
- Oswald
- Raleway
- Roboto
- Source Sans Pro
- Ubuntu
- Glory
- Nunito
- Poppins
- Quicksand
Video Presentation¶
How to apply fonts and create PDF template?¶
- After you install our extension, rebuild EspoCRM and clear cache
- Go to Administration -> PDF Templates
- Create new PDF Template
- Choose font
- Save
Why you have to rebuild EspoCRM?
That's because additional fonts can be removed, for example when you upgrade EspoCRM. When you click rebuild, our script will check if fonts are there, if not, then script will install fonts again.
How to add own fonts?¶
Available from 1.0.0 version
- Install our extension
- Log in to your FTP/SSH
-
Open custom directory. You have to make sure that you have these two directories. If you missing any folder, create it by yourself:
1.
custom/Espo/Custom/Resources/metadata/app
2.
custom/Espo/Custom/Resources/fonts
-
Go to Google Fonts and download font which you want to add. It should be Regular and Bold.
- Extract font and copy files with extension
*.ttf
tocustom/Espo/Custom/Resources/fonts
directory. We downloaded Fredoka font, so we copiedFredoka-Bold.ttf
andFredoka-Regular.ttf
. -
Go to
custom/Espo/Custom/Resources/metadata/app
and create file calledpdfEngines.json
. Paste and adjust with name of your font this code:{ "Tcpdf": { "fontFaceList": [ "__APPEND__", "fredoka" ] } }
-
Go to Administration section, Rebuild and Clear Cache
- Go to PDF Templates and change font in your Template
- Check PDF Template
How to add translation for custom font¶
- Log in to your FTP/SSH
- Create directory:
custom/Espo/Custom/Resources/i18n/en_US/
- Create there new file:
Template.json
-
Paste there this code and adjust with name of your custom font and translation:
{ "options": { "fontFace": { "fredoka": "Fredoka" } } }
-
Clear cache and test it.