2022-08-11 22:43:39 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Sets up the fonts for building the PDF output. It doesn't do it if we are not
|
|
|
|
# in a CI environment.
|
|
|
|
|
2022-10-13 13:53:17 +00:00
|
|
|
# Set up logging.
|
|
|
|
log() { echo "✒️ $(basename $0): $@"; }
|
|
|
|
|
|
|
|
# Move into the root directory.
|
|
|
|
cd $(dirname $(dirname $0))
|
|
|
|
|
|
|
|
# We only insert the fonts if we are on a CI server.
|
2022-08-11 22:43:39 +00:00
|
|
|
if [ "x$CI" == "x" ]
|
|
|
|
then
|
2022-10-13 13:53:17 +00:00
|
|
|
log "not in CI environment, not installing fonts"
|
2022-08-11 22:43:39 +00:00
|
|
|
else
|
2022-10-13 13:53:17 +00:00
|
|
|
log "installing fonts"
|
2022-08-11 22:43:39 +00:00
|
|
|
mkdir -p ~/.local/share/fonts
|
|
|
|
cp $(nix-build --no-out-link '<nixpkgs>' -A source-serif-pro)/share/fonts/opentype/*.otf ~/.local/share/fonts
|
|
|
|
cp $(nix-build --no-out-link '<nixpkgs>' -A source-sans-pro)/share/fonts/opentype/*.otf ~/.local/share/fonts
|
2022-10-13 13:53:17 +00:00
|
|
|
|
|
|
|
log "updating font caches"
|
2022-08-11 22:43:39 +00:00
|
|
|
fc-cache
|
|
|
|
fi
|