#!/bin/bash set -e IOSEVKA_VERSION=26.0.0 FONT_NAME=iosevka-prog FILE=$( readlink -f "${BASH_SOURCE[0]}" ) DIR=$( dirname "${FILE}" ) DIST="${DIR}/dist" OBLIQUE="${DIST}/oblique" REGULAR="${DIST}/regular" CONFIG="${DIR}/private-build-plans.toml" OUT_DIR="${DIST}/${FONT_NAME}/ttf" if [ -r "${CONFIG}" ]; then if command -v docker >/dev/null 2>&1; then docker pull avivace/iosevka-build docker pull nerdfonts/patcher docker run -e FONT_VERSION="${IOSEVKA_VERSION}" -it -v "$DIR":/build avivace/iosevka-build ttf::${FONT_NAME} sudo chown -R "$(id -u)":"$(id -g)" "${DIST}" mkdir -p "${OBLIQUE}" cp -af "${OUT_DIR}/${FONT_NAME}-oblique.ttf" "${OBLIQUE}" docker run --rm -v "${OBLIQUE}":/in -v "${OUT_DIR}":/out nerdfonts/patcher --complete --adjust-line-height --makegroups 1 mkdir -p "${REGULAR}" cp -af "${OUT_DIR}/${FONT_NAME}-regular.ttf" "${REGULAR}" docker run --rm -v "${REGULAR}":/in -v "${OUT_DIR}":/out nerdfonts/patcher --complete --adjust-line-height --makegroups 1 --mono --removeligatures sudo chown -R "$(id -u)":"$(id -g)" "${DIST}" cd "${OUT_DIR}" python3 "${DIR}/fontname.py" "Iosevka Prog Nerd Font" IosevkaProgNerdFont-Oblique.ttf python3 "${DIR}/fontname.py" "Iosevka Prog Nerd Font Mono" IosevkaProgNerdFontMono-Regular.ttf mkdir -p "iosevka-prog-nerd-$IOSEVKA_VERSION" mv Iosevka*Nerd*ttf "iosevka-prog-nerd-$IOSEVKA_VERSION" tar acf "${DIST}/iosevka-prog-nerd-${IOSEVKA_VERSION}.tar.xz" "iosevka-prog-nerd-$IOSEVKA_VERSION" mkdir -p "iosevka-prog-$IOSEVKA_VERSION" mv iosevka*ttf "iosevka-prog-$IOSEVKA_VERSION" tar acf "${DIST}/iosevka-prog-${IOSEVKA_VERSION}.tar.xz" "iosevka-prog-$IOSEVKA_VERSION" cd "${DIST}" ln -s "iosevka-prog-nerd-${IOSEVKA_VERSION}.tar.xz" "fonts-iosevka-prog-nerd_${IOSEVKA_VERSION}.orig.tar.xz" ln -s "iosevka-prog-${IOSEVKA_VERSION}.tar.xz" "fonts-iosevka-prog_${IOSEVKA_VERSION}.orig.tar.xz" else echo "Docker executable not found" fi else echo "Can't read config file ${CONFIG}" fi