I encode it manually instead:
download the font file, for example, FiraCode-VF.woff2
base64 '/Users/linonetwo/Downloads/Fira_Code_v6.2/woff2/FiraCode-VF.woff2' -o '/Users/linonetwo/Downloads/Fira_Code_v6.2/woff2/FiraCode-VF.woff2.base64.txt' as said in css - Converting and rendering web fonts to base64 - keep original look - Stack Overflow
put base64 string in the `
src: url(‘data:@file /octet-stream;base64,yourbase64’);
as said in html - Base64 encoded OpenType font-face using data URI - Stack Overflow
An example: fix: fira code loading is slow, use local version · tiddly-gittly/itonnote-theme@ff75e1a · GitHub
在2017年10月2日星期一 UTC+8 06:32:39 写道:
Hi Lin OneTwo,
It isn’t necessary to do the base64 encoding manually. Have a look at the font embedded in the “Startlight” theme that is accessed via the <<datauri>> macro:
title: $:/themes/tiddlywiki/starlight/styles.tid
tags: [[$:/tags/Stylesheet]]
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
/*
Placeholder for a more thorough refinement of Snow White
*/
@font-face {
font-family: "Arvo";
font-style: normal;
font-weight: 400;
src: local("Arvo"), url(<<datauri "$:/themes/tiddlywiki/starlight/arvo.woff">>) format("woff");
}
html body, .tc-sidebar-scrollable-backdrop {
font-family: "Arvo", "Times";
background: url(<<datauri "$:/themes/tiddlywiki/starlight/ltbg.jpg">>);
}
This file has been truncated. show original
Best wishes
Jeremy
2 Likes