#!/bin/sh # Craig Jennings # Script to install and configure fonts # ensure root if ! [ $(id -u) -eq 0 ] then echo "Must run as root. Exiting." exit fi # install packaged fonts pkg install -y noto-emoji pkg install -y urwfonts-ttf pkg install -y webfonts # font utilities pkg install -y fontconfig pkg install -y mkfontscale # install non-packaged fonts mkdir -p /usr/local/share/fonts/coding # install FiraCode Nerd Font wget -qO- https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.1/FiraCode.zip | \ tar -xvf- --directory /usr/local/share/fonts/coding/ # install Hack Nerd Font wget -qO- https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.1/Hack.zip | \ tar -xvf- --directory /usr/local/share/fonts/coding/ # install local font files to coding cp ../assets/fonts/* /usr/local/share/fonts/coding/ # don't enable antialiasing rm /usr/local/etc/fonts/conf.d/10-yes-antialias.conf # don't accept bitmap fonts rm /usr/local/etc/fonts/conf.d/70-yes-bitmaps.conf # don't disable sub-pixel-rendering rm /usr/local/etc/fonts/conf.d/10-sub-pixel-none.conf # enable sub-pixel rendering with the RGB stripes layout ln -s /usr/local/etc/fonts/conf.avail/10-sub-pixel-rgb.conf /usr/local/etc/fonts/conf.d/10-sub-pixel-rgb.conf # disable hinting ln -s /usr/local/etc/fonts/conf.avail/10-unhinted.conf /usr/local/etc/fonts/conf.d/10-unhinted.conf # set hintnone to hintstyle ln -s /usr/local/etc/fonts/conf.avail/10-hinting-none.conf /usr/local/etc/fonts/conf.d/10-hinting-none.conf # index the scalable fonts mkfontscale /usr/local/share/fonts/coding # create font.dir file index mkfontdir /usr/local/share/fonts/coding/ # update the font cache fc-cache -vf