~bkhl/dotfiles

73916b72916e94517a77e5b044e510a7457b2ee8 — Björn Lindström 12 hours ago 86679af main
Use Make to build custom Iosevka font
3 files changed, 26 insertions(+), 33 deletions(-)

D .Justfile
A .src/iosevka/Makefile
R .local/share/fonts/Iosevka/private-build-plans.toml => .src/iosevka/private-build-plans.toml
D .Justfile => .Justfile +0 -25
@@ 1,25 0,0 @@
_default:
    just --list

build_iosevka:
    #!/bin/bash

    set -xeuo pipefail

    font_dir="{{ justfile_directory () }}/.local/share/fonts/Iosevka"
    build_dir="$(mktemp -d -t iosevka.XXXXXXXX)"

    for plan in ttf::iosevka-bkhl-{sans,serif}-{normal,fixed}; do
        podman run --rm -t \
            -v "${build_dir}:/build:z" \
            -v "${font_dir}/private-build-plans.toml:/build/private-build-plans.toml:z" \
            -e FONT_VERSION="{{ IOSEVKA_VERSION  }}" \
            '{{ IOSEVKA_BUILD_IMAGE }}' \
            "${plan}"
    done

    cp -v "${build_dir}"/dist/iosevka-bkhl-*/ttf/*.ttf "${font_dir}/"

    echo "{{ IOSEVKA_VERSION }}" > "${font_dir}/FONT_VERSION"

    rm -rfv "${build_dir}"

A .src/iosevka/Makefile => .src/iosevka/Makefile +18 -0
@@ 0,0 1,18 @@
IMAGE := iosevka-builder
SRC := src
BUILD := build

.PHONY: all clean image fonts

all: image

clean:
	podman image rm $(IMAGE)
	rm -r $(SRC) $(BUILD)

image:
	git clone --branch v28.1.0 --depth=1 https://github.com/be5invis/Iosevka.git $(SRC)
	podman build -t $(IMAGE) -f $(SRC)/docker/Dockerfile $(SRC)/docker

fonts:
	podman run -t --rm -v .:/work:z $(IMAGE) ttf::iosevka-bkhl-{sans,serif}-{normal,fixed}

R .local/share/fonts/Iosevka/private-build-plans.toml => .src/iosevka/private-build-plans.toml +8 -8
@@ 2,8 2,8 @@
family = "Iosevka BKHL Sans Normal"
serifs = "sans"
spacing = "normal"
no-ligation = true
no-cv-ss = true
noLigation = true
noCvSs = true

  [buildPlans.iosevka-bkhl-sans-normal.variants.design]
  capital-q = "open-swash"


@@ 40,8 40,8 @@ no-cv-ss = true
family = "Iosevka BKHL Sans Fixed"
serifs = "sans"
spacing = "fixed"
no-ligation = true
no-cv-ss = true
noLigation = true
noCvSs = true

  [buildPlans.iosevka-bkhl-sans-fixed.variants]
  inherits = "buildPlans.iosevka-bkhl-sans-normal"


@@ 50,8 50,8 @@ no-cv-ss = true
family = "Iosevka BKHL Serif Normal"
serifs = "slab"
spacing = "normal"
no-ligation = true
no-cv-ss = true
noLigation = true
noCvSs = true

  [buildPlans.iosevka-bkhl-serif-normal.variants]
  inherits = "buildPlans.iosevka-bkhl-sans-normal"


@@ 83,8 83,8 @@ no-cv-ss = true
family = "Iosevka BKHL Serif Fixed"
serifs = "slab"
spacing = "fixed"
no-ligation = true
no-cv-ss = true
noLigation = true
noCvSs = true

  [buildPlans.iosevka-bkhl-serif-fixed.variants]
  inherits = "buildPlans.iosevka-bkhl-serif-normal"