char/iocgn-mono

iosevka variant inspired by Simple Köln-Bonn

git clone https://git.t4t.associates/char/iocgn-mono

Charlotte Somkerning tweaksa3bd267

main
1.7 KiB44 linesraw
1#!/usr/bin/env bash
2set -euo pipefail
3
4project=$(cd -- "$(dirname -- "$0")" && pwd)
5source_dir="$project/build/Iosevka"
6if [[ ! -d "$source_dir" ]]; then
7    git clone --depth 1 --branch v34.4.0 https://github.com/be5invis/Iosevka.git "$source_dir"
8fi
9cd "$source_dir"
10if [[ $(git rev-parse HEAD) != 8eb49cd124eb96e3817dd660f720c8d2885d2864 ]]; then
11    echo 'Expected Iosevka v34.4.0 in build/Iosevka; remove that directory to reclone.' >&2
12    exit 1
13fi
14if git apply --reverse --check "$project/patches/iosevka.patch" 2>/dev/null; then
15    : # Already patched.
16elif git apply --check "$project/patches/iosevka.patch"; then
17    git apply "$project/patches/iosevka.patch"
18else
19    echo 'Expected a clean v34.4.0 checkout or this exact Koeln patch in build/Iosevka.' >&2
20    exit 1
21fi
22cp "$project"/iocgn-*.mjs packages/font-glyphs/
23
24npm ci
25
26node --input-type=module - "$project/build-plan.toml" <<'JS'
27import fs from 'node:fs';
28import * as toml from '@iarna/toml';
29const config = toml.parse(fs.readFileSync(process.argv[2], 'utf8'));
30fs.writeFileSync('private-build-plans.toml', toml.stringify({buildPlans: config.buildPlans}));
31// Verda tracks .mjs sources, so a module rebuilds the masters when only the config changes.
32fs.writeFileSync('packages/font-glyphs/iocgn-config.mjs', `export default ${JSON.stringify(config)};\n`);
33JS
34npm run build -- ttf-unhinted::iocgnMono --jCmd=2
35
36mkdir -p "$project/build/native"
37cp private-build-plans.toml "$project/build/native/build-plan.toml"
38cp dist/iocgnMono/TTF-Unhinted/*.ttf "$project/build/native/"
39python3 "$project/tools/masters.py"
40python3 "$project/tools/oblique.py"
41python3 "$project/tools/combine.py"
42python3 "$project/tools/woff2.py"
43python3 "$project/tools/render_variable.py"
44python3 "$project/tools/render.py"