2021-12-13 08:13:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-01-13 13:24:52 +00:00
|
|
|
set -e
|
|
|
|
|
2023-04-24 07:52:09 +00:00
|
|
|
IOSEVKA_VERSION=22.1.0
|
2023-01-13 13:24:52 +00:00
|
|
|
FONT_NAME=iosevka-prog
|
2021-12-13 08:13:23 +00:00
|
|
|
FILE=$( readlink -f "${BASH_SOURCE[0]}" )
|
2023-01-12 07:52:55 +00:00
|
|
|
DIR=$( dirname "${FILE}" )
|
2023-01-13 13:24:52 +00:00
|
|
|
DIST="${DIR}/dist"
|
|
|
|
OBLIQUE="${DIST}/oblique"
|
|
|
|
REGULAR="${DIST}/regular"
|
2021-12-13 08:13:23 +00:00
|
|
|
CONFIG="${DIR}/private-build-plans.toml"
|
2023-01-13 13:24:52 +00:00
|
|
|
OUT_DIR="${DIST}/${FONT_NAME}/ttf"
|
2021-12-13 08:13:23 +00:00
|
|
|
|
|
|
|
if [ -r "${CONFIG}" ]; then
|
2023-01-12 07:52:55 +00:00
|
|
|
if command -v docker >/dev/null 2>&1; then
|
2023-04-24 08:34:10 +00:00
|
|
|
docker pull avivace/iosevka-build
|
2023-04-24 07:52:09 +00:00
|
|
|
docker pull nerdfonts/patcher
|
2023-04-24 08:34:10 +00:00
|
|
|
docker run -e FONT_VERSION="${IOSEVKA_VERSION}" -it -v "$DIR":/build avivace/iosevka-build ttf::${FONT_NAME}
|
2023-01-13 13:24:52 +00:00
|
|
|
sudo chown -R "$(id -u)":"$(id -g)" "${DIST}"
|
|
|
|
mkdir -p "${OBLIQUE}"
|
2023-01-16 11:34:20 +00:00
|
|
|
cp -af "${OUT_DIR}/${FONT_NAME}-oblique.ttf" "${OBLIQUE}"
|
2023-04-24 07:52:09 +00:00
|
|
|
docker run -v "${OBLIQUE}":/in -v "${OUT_DIR}":/out nerdfonts/patcher --complete --careful --adjust-line-height --makegroups || true
|
2023-01-13 13:24:52 +00:00
|
|
|
mkdir -p "${REGULAR}"
|
2023-01-16 11:34:20 +00:00
|
|
|
cp -af "${OUT_DIR}/${FONT_NAME}-regular.ttf" "${REGULAR}"
|
2023-04-24 07:52:09 +00:00
|
|
|
docker run -v "${REGULAR}":/in -v "${OUT_DIR}":/out nerdfonts/patcher --complete --careful --adjust-line-height --makegroups --mono --removeligatures || true
|
|
|
|
cd "${OUT_DIR}"
|
|
|
|
tar acf "${DIST}/fonts-iosevka-prog-nerd_${IOSEVKA_VERSION}.orig.tar.xz" Iosevka*Nerd*ttf
|
|
|
|
tar acf "${DIST}/fonts-iosevka-prog_${IOSEVKA_VERSION}.orig.tar.xz" iosevka*ttf
|
|
|
|
tar acf "${DIST}/iosevka-prog-${IOSEVKA_VERSION}.tar.xz" *ttf
|
2021-12-13 08:13:23 +00:00
|
|
|
else
|
|
|
|
echo "Docker executable not found"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Can't read config file ${CONFIG}"
|
|
|
|
fi
|
|
|
|
|