Home

Awesome

custom-fonts-in-emails

build status code style styled with prettier made with lass license

An extremely easy way to use custom fonts in emails without having to use art software.

Table of Contents

Features

What does this do

Old Approach

Here's the old, slow, and convoluted way you'd do this:

  1. Typically you'd have to open Photoshop, GIMP, or Sketch (wait for the updates to finish), and then create an image with this text, select the font, color, and then save it as an image.
  2. Then upload it somewhere or have to wait until it deploys to production so you have a valid non-local URL (which is prone to caching in Gmail – in other words... if you ever need to make a slight adjustment to it then you have to completely rename the file).
  3. Reference the image in your HTML and try to rememember it's dimensions, or have to open up the art software again to get dimensions. What about Retina? What if you need to change the size or color of the font? What if you need to convert points to pixels? Just forget it... It's too complicated and time consuming, and now your emails will look boring like they always did! :frowning: :rage:

New Approach

:boom: You don't need to do that anymore! :smile: Here's how easy it is:

import customFonts from 'custom-fonts-in-emails';
import path from 'path';

const options = {
  text: 'Make something people want',
  fontNameOrPath: 'GoudyBookletter1911',
  fontColor: 'white',
  backgroundColor: '#ff6600',
  fontSize: 40
};

customFonts.png2x(options)
  .then(console.log)
  .catch(console.error);
<img width="461" height="51" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA5oAAABmCAYAAACqTe50AAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR4nO2dd3gUVdvG7930hISEXoJ0pBelI0WqCIhiQcWKvXexd7GCvXdfGyogoqBSFFBEQXqTpvROQkIaKfv9cbNfdmfPmZ3ZnU2R53dduSCT2dmzO2fOefoT7bkaHgiCIAiCIAiCIAiCE3gw3l3eYxAEQRAEQRAEQRD+W4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiKKJqCIAiCIAiCIAiCo4iiKQiCIAiCIAiCIDiK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/AbAUxL4t1rNgNtmA+MWAt0vAZKq27t2envg4neAO+cBiT7VZQ9tAz64JLxxh0JCVaDVIPXfBtwCVDuhbMcjWKPTWYA7KvB4UjVg4O1ATELZj0kQhApFdHkPQBAEQRAEBcumAl/dAZz3gvrvTXrwp6QY2LoE2LES2LOOntC8LKD4KHtixqcAKXWABh2Ahl0CW6cAfM1LQ4CMHZH9TADzTeu2Bhp35fjbD+f4VDTtBTy1FThygD85B4HMXcDBf4F1s4G1P0V+vAKJTwYadgaadAea9wnM7fXlnOeBM8cDR/bzvmXvAw5tB/ZtBP74pGzmmSAI5Y4omoIgCIJQUZnzIrB/M3DJu0ByLfU57iigcTf+hMLqGcDHV6pDdZ1m2IPA4Lvsh8RWqcEfXwbfBUzoB2yY59jwBAXJtYBrvgaa9lR7MHVExwKp9fnjS49LgYcVxg5BEP5zSOisIAiCIFRkVk4HHmsP/PIaUJjv3HU3LwReGwG8MqxslEwAOPVGZ/Mua5/o3LUENU16sBCVHSXTjFrNnLuWIAgVGvFoCoIgCEJFJ2sv8PmNwLQHgJPPBdoMBVr0sZefWZjPENt1s4G/vgJ2r43ceHWs/A7oNZbhlFl7gMN7GA6bcwjIzWDILwAU5QNH8/j/hKoMt42vAkTFAHFVmAcYHQes+aHsP8PxxtYlnH+JaQyBzdjBkNjcDCAnA8g9BBQW8Ny8w8wr9t4nlwtITOX9S0zjfdu9juHegiD85xFFUxAEQRAqC7mZwIJ3+AMAaen06qXWY4ijO5qCfcERoLioVKE7sAXYuxEoKSrf8X98BfC/q9RFjoSKSeZO4O56cs8EQbCNKJqCIAiCUFnJ2FH5CquIwlL5kHsmCEIISI6mIAiCIAiCIAiC4CiiaAqCIAiCIAiCIAiOIoqmIAiCIAiCIAiC4CiiaAqCIAiCIAiCIAiOEg3gnfIehCAIgiAIgiAIgvAfwYXF/wcBvOMtgYCpzAAAAABJRU5ErkJggg==" title="Make something people want" alt="Make something people want" style="color: white;font-size: 25.5px;line-height: 51px;text-align: center;background-color: #ff6600;">
<img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/png@2x.png" title="Make something people want" alt="Make something people want" style="color: white;font-size: 25.5px;line-height: 51px;text-align: center;background-color: #ff6600;">

You can now use any font in your emails – without having to use art software like Photoshop or Sketch!

It supports system-wide and node_modules fonts out of the box, but you can pass a file path if you wish to use a custom non-standard font. You can also customize its kerning, anchor, color/fill, stroke, font size (even in points if needed), add custom attributes to the HTML tag, and more! See Usage, Options, and the API reference below for more info.

It even uses the fast-levenshtein algorithm to detect the closest match to the spelling of a font (e.g. in case you mispellled Arial as Arail).

Examples

Using the options defined in New Approach above, the following code provides examples of this package's API methods.

API Method and PreviewImage Type
customFonts.svg(options) <img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/image.svg" style="background-color: #ff6600;color: white;font-size: 20px;line-height: 40px;text-align: center;" title="Make something people want" alt="Make something people want">SVG tag <svg>
customFonts.img(options) <img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/img.svg" style="background-color: #ff6600;color: white;font-size: 20px;line-height: 40px;text-align: center;" title="Make something people want" alt="Make something people want">IMG tag <img> with Base64-encoded Inline SVG
customFonts.png(options, scale) <img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/png.png" style="background-color: #ff6600;color: white;font-size: 20px;line-height: 40px;text-align: center;" title="Make something people want" alt="Make something people want">IMG tag <img> with Base64-encoded Inline PNG
customFonts.png@2x(options) <img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/png@2x.png" style="background-color: #ff6600;color: white;font-size: 20px;line-height: 40px;text-align: center;" title="Make something people want" alt="Make something people want">IMG tag <img> with Base64-encoded Inline PNG @2x Resolution
customFonts.png@3x(options) <img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/png@3x.png" style="background-color: #ff6600;color: white;font-size: 20px;line-height: 40px;text-align: center;" title="Make something people want" alt="Make something people want">IMG tag <img> with Base64-encoded Inline PNG @3x Resolution

Lastly, here's what a broken image looks like that was attempted to be rendered with an API method. It makes use of the option supportsFallback defined below in Options. This is a really useful fallback for offline emails, invalid cached images, and more!

<img width="461" height="51" src="https://raw.githubusercontent.com/ladjs/custom-fonts-in-emails/master/art/fallback@2x.png" title="Make something people want" alt="Make something people want">

Install

npm install -s custom-fonts-in-emails

Usage

import customFonts from 'custom-fonts-in-emails';

or

import {
  setDefaults,
  setOptions,
  svg,
  img,
  png,
  png2x,
  png3x,
  getClosestFontName,
  getFontPathsByName,
  getFontPathByName,
  getAvailableFontPaths,
  getAvailableFontNames,
  // optional: this is a cache of all the custom fonts loaded
  customFontsCache
} from 'custom-fonts-in-emails';

If you plan to use this for outbound emails, then you'll want to make use of nodemailer and nodemailer-base64-to-s3. Or you can simply use Lad, which has this built-in already!

Options

The options argument in all API methods is an Object that accepts the following properties:

PropertyTypeDescription
textStringText to write using the font family specified in fontNameOrPath (defaults to an empty String of '')
fontNameOrPathStringName or file path of the font (defaults to Arial – note that by default we load user, local, network, system, and node_modules fonts across any operating system using os-fonts, so you can use any font installed!)
fontSizeNumber or StringSize of font in pixels, which is rounded to nearest whole Integer (this automatically sets options.textToSvg.fontSize – defaults to 24px, but you don't need to specify the affix px as it is automatically stripped and converted to the nearest whole Integer using Math.round(parseInt(val, 10)) – this value must be greater than 0)
fontColorStringValid hex color or rgba value to render the text fill color with with (defaults to #000)
backgroundColorStringValid hex color or rgba value to render the background color with (defaults to transparent)
supportsFallbackBooleanEnsure that the output image has fallback attributes title and alt (both set to the value of options.text), and style which is set to or concatenated with color set to options.fontColor, font-size set to options.fontSize / 2 (for vertical centering we divide by 2), line-height set to options.fontSize affixed with px, and finally text-align: center &ndash not applicable to customFonts.svg (defaults to true)
resizeToFontSizeBooleanEnsure that the output image height is resized to fontSize, and its width is proportionally scaled – not applicable to customFonts.svg nor customFonts.img (defaults to false)
trimBooleanEnsure that the output image is trimmed using sharp's trim API method – it trims "boring" pixels from the edges – not applicable to customFonts.svg nor customFonts.img (defaults to false)
trimToleranceNumberMust be from 1-99 inclusive, sets the trim tolerance value using trim (defaults to 10)
attrsObjectAttribute key-value pairs that will be applied to the returned tag (defaults to {}, e.g. if you want to make the image output a fixed height scaled proportionally, then you can do { style: 'height: 40px; width: auto;' }, this is useful if you want to add custom CSS classes, style attributes, or other attributes in general to the returned tags)
textToSvgObjectOptions defined in textToSvg below which get passed to text-to-svg (and subsequently opentype.js):

textToSvg

PropertyTypeDescription
xNumberHorizontal position of the beginning of the text (defaults to 0)
yNumberVertical position of the baseline of the text (defaults to 0)
fontSizeNumberSize of the text in points (defaults to options.fontSize)
anchorStringAnchor of object in coordinate (defaults to left top – the String consists of horizontal vertical, where horizontal can be one of left, center, or right, and vertical can be one of baseline, top, middle, bottom)
attributesObjectAttribute key-value pairs that will be applied to the returned <path> element inside the <svg> tag (defaults to { fill: '#000', stroke: 'none' } – note that if you specify fontColor then it will set fill equal to fontColor, but it can be overridden this attribute explicitly!)

API

customFonts.setDefaults(options)

A function that accepts options to set defaults for future use and returns a Promise that resolveswith the new package defaults.

customFonts.setOptions(options)

A function that accepts options and returns a Promise that resolves with refined options.

customFonts.svg(options)

A function that accepts options and returns a Promise that resolves with a String of the <svg> HTML tag for the custom font.

This function takes the argument options and passes it to customFonts.setOptions.

customFonts.img(options)

Same as customFonts.svg, except it returns the String as Base64 inlined data.

customFonts.png(options, scale)

Same as customFonts.img, except it returns Base64 inlined data for a PNG instead of an SVG.

It also optionally accepts a Number scale (defaults to 1), which will scale the image for retina support.

For example, if the font rendered is 20px, then it will multiply 20px by scale (e.g. if scale is 2, then the image returned will be 20px but it will be scaled to 40px).

customFonts.png2x(options)

Same as customFonts.png, except it returns an image with twice as many pixels (it multiplies fontSize * 2 and returns an image scaled to 1x for 2x retina support, it passes 2 as the scale).

customFonts.png3x(options)

Same as customFonts.png, except it returns an image with three as many pixels (it multiplies fontSize * 3 and returns an image scaled to 1x for 3x retina support, it passes 3 as the scale).

customFonts.getAvailableFontPaths()

A function that returns an Array of file paths for all of the user, local, network, system, and node_modules fonts available on the current operating system.

customFonts.getAvailableFontNames()

The same as customFonts.getAvailableFontPaths, except it returns font names instead of font paths.

customFonts.customFontsCache

This is an object of all of the custom fonts cached.

<!-- ## Wishlist * \[ ] [svg/svgo#620](https://github.com/svg/svgo/issues/620) * \[ ] [svg/svgo#619](https://github.com/svg/svgo/issues/619) * \[ ] [nodebox/opentype.js#238](https://github.com/nodebox/opentype.js/issues/238) * \[ ] [jergason/recursive-readdir#35](https://github.com/jergason/recursive-readdir/pull/35) * \[ ] [shrhdk/text-to-svg#20](https://github.com/shrhdk/text-to-svg/issues/20) * \[ ] [shrhdk/text-to-svg#19](https://github.com/shrhdk/text-to-svg/issues/19) * \[ ] [shrhdk/text-to-svg#18](https://github.com/shrhdk/text-to-svg/issues/18) ## Credits Thanks to the public domain font [GoudyBookletter1911][goudybookletter1911] for test purpose and our friends in [the Slack channel][slack-url] for support. -->

License

MIT © Nick Baugh