diff --git a/default/fonts/omarchy/omarchy.ttf b/default/fonts/omarchy/omarchy.ttf index c6b76994..2172c05e 100644 Binary files a/default/fonts/omarchy/omarchy.ttf and b/default/fonts/omarchy/omarchy.ttf differ diff --git a/test/shell.d/release-ai-port-test.sh b/test/shell.d/release-ai-port-test.sh index 7521f1a5..d90695c8 100644 --- a/test/shell.d/release-ai-port-test.sh +++ b/test/shell.d/release-ai-port-test.sh @@ -65,3 +65,58 @@ pass "baseline mise setup tolerates an unfinished Hermes Desktop and disables pr PATH="$test_tmp/bin:$PATH" bash -euo pipefail "$ROOT/migrations/1787215483.sh" >/dev/null grep -qx 'mise:settings set upgrade.auto_prune false' "$TEST_CALLS" || fail "existing users retain running mise versions" pass "mise migration applies the same no-pruning setting" + +# Exercise the documented font workflow, not just fontconfig's charset reader. +# Work on a disposable copy: adding a fixture must never edit the source font. +python3 - "$ROOT" "$test_tmp" <<'PY' +import pathlib +import runpy +import shutil +import struct +import subprocess +import sys + +root, temporary = map(pathlib.Path, sys.argv[1:]) +tool = root / 'bin/omarchy-dev-font' +font = temporary / 'omarchy.ttf' +shutil.copyfile(root / 'default/fonts/omarchy/omarchy.ttf', font) +api = runpy.run_path(str(tool)) + +def snapshot(): + data, tables, count = api['load_font'](str(font)) + offsets = api['read_loca'](data, tables, count) + names = api['read_names'](data, tables['post'][0], count) + cmap = api['read_cmap'](data, tables['cmap'][0]) + start = tables['glyf'][0] + glyphs = [data[start + offsets[i]:start + offsets[i + 1]].rstrip(b'\0') for i in range(count)] + metrics = data[tables['hmtx'][0]:sum(tables['hmtx'])] + assert struct.unpack_from('>I', data, tables['post'][0])[0] == 0x20000 + return names, cmap, glyphs, metrics + +before = snapshot() +assert before[0][before[1][0xE90D]] == 'cursor' +assert 0xE909 not in before[1] +listing = subprocess.check_output([sys.executable, str(tool), 'list', '--font', str(font)], text=True) +for cp, name, _ in api['glyph_list'](str(font)): + assert f'U+{cp:04X}' in listing and name in listing +assert 'U+E90D' in listing and 'cursor' in listing +print('ok - the shipped font lists its named Cursor mark through the real font tool') + +svg = temporary / 'fixture.svg' +svg.write_text('') +subprocess.run([sys.executable, str(tool), 'add', 'release-fixture', str(svg), '--font', str(font)], check=True, stdout=subprocess.DEVNULL) +after = snapshot() +assert after[0] == before[0] + ['release-fixture'] +assert after[1] == before[1] | {0xE90E: len(before[0])} +assert after[2][:-1] == before[2] +assert after[3].startswith(before[3]) +print('ok - adding a local SVG preserves every existing name, codepoint, outline and metric') +listing = subprocess.check_output([sys.executable, str(tool), 'list', '--font', str(font)], text=True) +assert 'U+E90E' in listing and 'release-fixture' in listing and 'cursor' in listing +print('ok - the real font tool lists the newly added disposable glyph') +unchanged = font.read_bytes() +result = subprocess.run([sys.executable, str(tool), 'add', 'collision', str(svg), '--codepoint', 'E90D', '--font', str(font)], capture_output=True, text=True) +assert result.returncode != 0 and 'already used' in result.stderr +assert font.read_bytes() == unchanged +print('ok - adding over Cursor is rejected without changing the font') +PY