#!/bin/bash set -e IOSEVKA_VERSION=31.4.1 FONT_NAME=IosevkaProg 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 wget -c https://github.com/be5invis/Iosevka/archive/refs/tags/v${IOSEVKA_VERSION}.tar.gz tar axf v${IOSEVKA_VERSION}.tar.gz pushd Iosevka-${IOSEVKA_VERSION}/docker docker build -t=iosevka-builder . popd rm -rf Iosevka-${IOSEVKA_VERSION} v${IOSEVKA_VERSION}.tar.gz docker pull cdalvaro/docker-nerd-fonts-patcher:latest docker run -e FONT_VERSION="${IOSEVKA_VERSION}" -it -v "$DIR":/work iosevka-builder 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