user-font-demo.4th: prove the override mechanism (item 4.3.6e)

Punch list §25 item 4.3.6e complete. Optional capsule, not wired into
the boot chain, overriding DISPATCH-UPPER's codepoint 65 (G-A) with a
marked alternate glyph while every other letter falls through to
font.4th's originals unchanged.

Corrects §27.6.5: redefining the DISPATCH-* bucket word alone is not
enough, since DISPATCH-GLYPH/DRAW-GLYPH are themselves compiled early
against font.4th's own dispatch words (same early-binding finding as
4.3.6c, one layer up). Verified both ways: the partial override (bucket
word only) left DRAW-GLYPH still drawing the original glyph; redefining
DISPATCH-GLYPH/DRAW-GLYPH too made the override take effect.

Three-arch acceptance boot clean, Stadium conservation unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-09 20:41:04 -04:00
co-authored by Claude Sonnet 5
parent ef930ce04e
commit aee09cac0a
13 changed files with 54885 additions and 60 deletions
+6 -2
View File
@@ -1,5 +1,5 @@
# Capsule Block Manifest — Auto-generated
<!-- Generated by mkcapsule --manifest 2026-08-10T00:31:39Z -->
<!-- Generated by mkcapsule --manifest 2026-08-10T00:39:34Z -->
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
<!-- Hand-written justifications and immutability notes live -->
<!-- in MANIFEST.md alongside this auto-generated index. -->
@@ -35,6 +35,7 @@
| `init.4th` | 2049, 2050, 2057 | `0x214d424abd382707` |
| `lib.4th` | 4050 | `0x20625ebf1276c239` |
| `process.4th` | 4300, 4301 | `0x781afc1dbd0294f7` |
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` |
| `zuse.4th` | 4016, 4017, 4018 | `0x12f38ec782434a77` |
## Block Map (sorted by LBN)
@@ -188,6 +189,9 @@
| 4174 | `artemis:init.4th` | `0xc9e92cd18f4c7b49` | ok |
| 4175 | `hermes:init.4th` | `0x85c7b311d1e5bf97` | ok |
| 4176 | `hermes:init.4th` | `0x85c7b311d1e5bf97` | ok |
| 4200 | `user-font-demo.4th` | `0xce1fd7d1b581a56d` | ok |
| 4201 | `user-font-demo.4th` | `0xce1fd7d1b581a56d` | ok |
| 4202 | `user-font-demo.4th` | `0xce1fd7d1b581a56d` | ok |
| 4300 | `process.4th` | `0x781afc1dbd0294f7` | ok |
| 4301 | `process.4th` | `0x781afc1dbd0294f7` | ok |
| 4406 | `init-1.4th` | `0x63e251adb0a03613` | ok |
@@ -320,4 +324,4 @@
None.
---
*28 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
*29 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
+41
View File
@@ -0,0 +1,41 @@
Block 4200
( user-font-demo.4th -- proves the 4.3.6e override mechanism. )
( Redefines DISPATCH-UPPER, overriding G-A with a marked )
( alternate (an X through the A) while every other letter )
( still calls font.4th's existing G-B..G-Z (not redefined). )
: G-A-ALT ( -- adv )
100 0 275 700 G-LINE
275 700 450 0 G-LINE
190 350 360 350 G-LINE
100 700 450 0 G-LINE
550 ;
Block 4201
: DISPATCH-UPPER ( codepoint -- adv ) CASE
65 OF G-A-ALT ENDOF 66 OF G-B ENDOF 67 OF G-C ENDOF
68 OF G-D ENDOF 69 OF G-E ENDOF 70 OF G-F ENDOF
71 OF G-G ENDOF 72 OF G-H ENDOF 73 OF G-I ENDOF
74 OF G-J ENDOF 75 OF G-K ENDOF 76 OF G-L ENDOF
77 OF G-M ENDOF 78 OF G-N ENDOF 79 OF G-O ENDOF
80 OF G-P ENDOF 81 OF G-Q ENDOF 82 OF G-R ENDOF
83 OF G-S ENDOF 84 OF G-T ENDOF 85 OF G-U ENDOF
86 OF G-V ENDOF 87 OF G-W ENDOF 88 OF G-X ENDOF
89 OF G-Y ENDOF 90 OF G-Z ENDOF
DROP TOFU ENDCASE ;
Block 4202
( DISPATCH-GLYPH/DRAW-GLYPH also redefined here -- found in )
( 4.3.6c, not just documented in 27.6.5: they were compiled )
( early too (in font.4th, against font.4th's own DISPATCH-*), )
( so redefining DISPATCH-UPPER alone would not be picked up. )
: DISPATCH-GLYPH ( codepoint -- adv )
DUP 48 58 WITHIN IF DISPATCH-DIGIT EXIT THEN
DUP 65 91 WITHIN IF DISPATCH-UPPER EXIT THEN
DUP 97 123 WITHIN IF DISPATCH-LOWER EXIT THEN
DUP 32 127 WITHIN IF DISPATCH-ASCII-PUNCT EXIT THEN
DUP 160 256 WITHIN IF DISPATCH-LATIN1 EXIT THEN
DUP 8192 8304 WITHIN IF DISPATCH-GENPUNCT EXIT THEN
DROP TOFU ;
: DRAW-GLYPH ( codepoint x y size color -- adv )
GCOLOR ! GSIZE ! GOY ! GOX !
DISPATCH-GLYPH ;