DocKing - ShipSaaS
Docking GitHub
  • DocKing from ShipSaaS
  • Architecture
  • Requirements
  • PDF Engines
    • Gotenberg
    • WkHTMLtoPDF
    • mPDF
  • Upgrade Notes
    • v1.4.0
    • v1.3.2
    • v1.3.1
    • v1.3.0
    • v1.2.0
    • v1.1.2
    • v1.1.1
    • v1.1.0
  • Usage
    • Basic
    • Endpoints
    • Webhook
    • Maintain IDs/Keys from Services
  • Getting Started
    • Environment Variables
    • Run on Local
      • Normal Run
      • Docker
    • Storage
    • Console UI
    • Document Template
      • Gotenberg's Metadata
      • wkHTMLtoPDF's metadata
      • mPDF's metadata
    • Templating Mode
    • Fonts
    • Octane / High-perf mode
    • Localization
  • Deployment
    • Linux VPS / Dedicated Server
    • Docker
Powered by GitBook
On this page
  • Gotenberg
  • WkHtmlToPdf
  • mPDF
  1. Getting Started

Fonts

How to add and use Custom Fonts

PreviousTemplating ModeNextOctane / High-perf mode

Last updated 1 year ago

This documentation shows you how to add and use custom fonts.

Gotenberg

To add more fonts for Gotenberg, you have to build a Docker Image and distribute it.

Ref:

FROM gotenberg/gotenberg:7

USER root

COPY /local/path/to/{font}.ttf /usr/local/share/fonts/{font}.ttf

USER gotenberg

WkHtmlToPdf

WkHtmlToPdf will use the fonts from the server (Linux or Windows).

Alternatively, you can use the <link href="font-url" /> (require internet connection)

mPDF

You can use the "Fonts" from Console UI to fonts, then set metadata to use the custom font:

// metadata
{
  "custom-fonts": ["font-key-1", "font-key-2"]
}

// from your template
<style>
* {
  font-family: "font-key";
}
</style>

Note: mPDF only supports .tff fonts

https://gotenberg.dev/docs/customize/fonts