nerd-fonts/bin/scripts/generate-webfonts.sh
Fini Jastrow 3b1329aefb CI: Fix: Automatically deploy webfonts [skip ci]
[why]
From the name we used the non-Mono Symbols font for the webfonts. But in
the Cheat Sheet we want to display the icons all in nice boxes, all with
the same size. That is not the case for the non-Mono font, here all
glyphs are unscaled and thus do not match each other.

[how]
Use the Nerd Font Mono variant for the webfont, as the icons here all
have the same size and are surrounded by their bounding box, making
working with them a lot easier.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-12-16 19:08:53 +01:00

19 lines
723 B
Bash
Executable file

#!/usr/bin/env bash
# Nerd Fonts Version: 2.3.0-RC
# Script Version: 1.0.0
# Generates web fonts for the website and cheat sheet
# Destination in the gh-pages branch:
# ./assets/fonts/Symbols-2048-em Nerd Font Complete.woff2
# ./assets/fonts/Symbols-2048-em Nerd Font Complete.woff
font_file="Symbols-2048-em Nerd Font Complete"
patched_dir="../../patched-fonts/NerdFontsSymbolsOnly/complete"
webfontdir="../../webfonts"
if [ ! -d "${webfontdir}" ]; then
mkdir "${webfontdir}"
fi
fontforge -lang=ff -c "Open(\"${patched_dir}/${font_file} Mono.ttf\"); Generate(\"${webfontdir}/${font_file}.woff\")"
fontforge -lang=ff -c "Open(\"${patched_dir}/${font_file} Mono.ttf\"); Generate(\"${webfontdir}/${font_file}.woff2\")"