Appearance
Custom Fonts
The customFonts option controls the font dropdown in the editor. Fonts can be added alongside the built-in list or replace it entirely, whether they come from Google Fonts, your own server, or the operating system.
How to set custom fonts in the plugin
Add a customFonts configuration to your TOPOL_OPTIONS object:
ts
const TOPOL_OPTIONS = {
// ... other options ...
customFonts: {
override: false, // If true, it replaces default fonts. If false, it appends.
fonts: [
{
label: "Mukta", // Name shown in the font selector
style: "Mukta, sans-serif", // Font stack (MUST include fallback)
url: "https://fonts.googleapis.com/css2?family=Mukta:wght@400;700", // URL to the font CSS
},
{
label: "Lora",
style: "'Lora', serif",
url: "https://fonts.googleapis.com/css2?family=Lora:wght@400;700",
},
],
},
};INFO
Please keep in mind that font names with space (two or more words), needs to be inside brackets, e.g. '"Verdana Pro", sans-serif' or "'Verdana Pro', sans-serif"
WARNING
An invalid fonts array fails validation as a whole. The editor keeps its default fonts and shows an error notification, so a single malformed entry discards the rest. Fonts are also not stored in the saved template, which means customFonts has to be supplied on every initialization.
Key properties explained
label: The name users will see in the font dropdown in the editor. Matching it to the first family instylekeeps the dropdown readable, though the two are independent and nothing enforces the match.style: The full CSS font stack (make sure to include fallback fonts like sans-serif, serif, etc.). This is the value written into the template.url: The external link to the CSS file for the font, either Google Fonts or a self-hosted stylesheet. Optional, and left out for fonts already present on the recipient's system.
System fonts
Fonts installed on the recipient's device need no stylesheet, so omit url entirely:
ts
customFonts: {
override: false,
fonts: [
{
label: "Tahoma",
style: "Tahoma, Geneva, sans-serif",
},
],
},The missing font notice treats a font without a url as available only if it is one of these common system fonts: Arial, Arial Black, Book Antiqua, Comic Sans MS, Courier, Courier New, Garamond, Georgia, Helvetica, Helvetica Neue, Impact, Lucida Console, Lucida Grande, Lucida Sans Unicode, Palatino, Palatino Linotype, Segoe UI, Tahoma, Times, Times New Roman, Trebuchet MS, and Verdana. Any other font without a url, such as Calibri, is named in the notice even though it is listed in customFonts.
The built-in list works the same way. It holds 15 fonts, of which Arial, Georgia, Helvetica, and Verdana are system fonts with no URL, while Bitter, Cabin, Lato, Merriweather, Open Sans, PT Sans, PT Serif, Roboto, Ubuntu, Poppins, and Oswald load from Google Fonts. Setting override: true removes all 15, so include any of them you still want.
Google Fonts integration
If you're using Google Fonts, just copy the link from the Google Fonts website and paste it into the url field. No need to install anything separately.
When the email HTML is generated, Google Fonts links in the older fonts.googleapis.com/css?family=… format get subset=latin,latin-ext added, unless the link already sets its own subset. Without it, some mail clients, Apple Mail among them, receive only basic Latin letters and show accented characters in the fallback font. Links in the newer css2 format already include every character set and stay as they are. Lato is the exception. The version Google serves has no Czech or Slovak letters such as č, ř or ů, so text set in Lato shows those letters in the next font of its stack.
The image editor receives the same customFonts configuration, so no separate key is needed for Google Fonts inside images.
For more information, visit this article.
Self-hosted fonts
DANGER
When working with fonts, always ensure you set suitable web-safe fonts and operating system fonts as fallback options. Custom fonts are significantly limited across various email clients.
If you're using your own font files, you can host the font CSS (using @font-face declarations) on your own server and reference it just like you would with a Google Font. Be sure to serve .woff or .woff2 formats for the best compatibility with the few email clients that support custom web fonts.
Fonts missing from a template
Preview names any font that recipients won't get. A font counts as available when it is one of these:
- a custom font with a
url - one of the editor's default fonts, even with
override: true, which removes them from the font list - a system font
For any other font, Preview shows "Some fonts in this email are not available: {fonts}. Recipients will see a fallback font." Each font is named by the first family in its stack. To clear the notice, add the font with its url to customFonts, or switch the affected text to an available font.
Preview needs a connection. When the browser is offline, Preview doesn't open and the editor says "Preview is only available while you are online. Please check your connection and try again."
Font sizes
The fontSizes option sets the sizes offered in the editor's size dropdown, as unitless pixel numbers:
ts
fontSizes: [12, 14, 16, 18, 24, 32],This list always replaces the default one, which is [11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 30, 36, 48, 64]. There is no override flag. Users can still type any size manually; this only changes the offered presets.
