Fonts with Obsidian Publish

Unfortunately font files are not supported with Obsidian Publish. There are a few workarounds:

  1. Use google fonts or host your files on a CDN
  2. base64 encode your .woff or .ttf

I chose option 2.

Encode font

base64 -i bembo-webfont.ttf | pbcopy

Embed font

Replace <BASE64_STRING_HERE>

@font-face {
    font-family: 'bembo';
    src: url(data:font/truetype;charset=utf-8;base64,<BASE64_STRING_HERE>) format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    --font-text-theme: 'bembo';
}
Fonts with Obsidian Publish
Interactive graph
On this page
Encode font
Embed font