Skip to content

Dubas Google Fonts Extension

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

Video Presentation

How to apply fonts and create PDF template?

  1. After you install our extension, rebuild EspoCRM and clear cache
  2. Go to Administration -> PDF Templates
  3. Create new PDF Template
  4. Choose font
  5. 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

  1. Install our extension
  2. Log in to your FTP/SSH
  3. 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

  4. Go to Google Fonts and download font which you want to add. It should be Regular and Bold.

  5. Extract font and copy files with extension *.ttf to custom/Espo/Custom/Resources/fonts directory. We downloaded Fredoka font, so we copied Fredoka-Bold.ttf and Fredoka-Regular.ttf.
  6. Go to custom/Espo/Custom/Resources/metadata/app and create file called pdfEngines.json. Paste and adjust with name of your font this code:

    {
        "Tcpdf": {
            "fontFaceList": [
                "__APPEND__",
                "fredoka"
            ]
        }
    }
    
  7. Go to Administration section, Rebuild and Clear Cache

  8. Go to PDF Templates and change font in your Template
  9. Check PDF Template

How to add translation for custom font

  1. Log in to your FTP/SSH
  2. Create directory: custom/Espo/Custom/Resources/i18n/en_US/
  3. Create there new file: Template.json
  4. Paste there this code and adjust with name of your custom font and translation:

    {
        "options": {
            "fontFace": {
                "fredoka": "Fredoka"
            }
        }
    }
    
  5. Clear cache and test it.

Back to top