Note that
optimise_fonts_for_html_contents circumvents css files. The implication being that fonts are only optimized based on rough information visible in the HTML, instead of full granularity.
This means that it is incompatible with the
KaTeX font files as those are mainly styled using classes. Perhaps I can get it to work at a future point, but I’d have to toy with Hakyll quite a bit. I’d need to give
fontimize the right version of the website, and to use the optimized font files afterwards in the final output.
. This implies wrangling my nix environment a bit and writing a python script, invoking it via # Optimizing is as simple as calling a single function.
optimise_fonts_for_html_contents(
html_contents=[html.read() for html in html_files],
fonts=font_file_paths,
subsetname="subset",
print_stats=False,
)