Hong Kong Cantonese–English Bilingual Stroke Dynamics via Zero-Asset OS Canvas2D, WebGL2 1+JFA 2D SDF,
Solo Self-Initiated Work · Part III of the Perceptual Computation pure-code media series
Zero font binaries · Zero image textures · Zero audio samples — every glyph field, stroke ribbon, and vowel resonance is synthesized procedurally in real time.
Polyglot Drift investigates everyday Hong Kong bilingual code-switching—where Traditional Chinese calligraphic stroke topology and Swiss International Typographic Grid geometry coexist across street signage, cinema subtitles, and spoken prosody:
-
Zero-Asset OS Native
Canvas2DBilingual Rasterization (1024 × 512):- Rasterizes
5curated Hong Kong Cantonese idioms (見步行步,獅子山下,霓虹殘影,山海之間,聲氣相通) with full Cantonese Jyutping romanization (tones 1–6), morpheme breakdowns, and English curatorial glosses into symmetric Nine-Palace (九宮格) cells and a 2-line Asymmetric Dual-Anchor Swiss Grid.
- Rasterizes
-
WebGL2
1+JFADual-Field Jump Flooding Signed Distance Field:- Sub-pixel zero-contour localization followed by
step = 1pre-pass +10halving passes (512..1), outputting signed Euclidean distance$d(\mathbf{x})$ and medial-axis skeleton ridges (RGBA16Fwith automatic 16-bitpackU16RGBA8gl.NEARESTfallback).
- Sub-pixel zero-contour localization followed by
-
12,000Medial-Axis Stroke Particles &< 5 ms$O(KN\log N)$ 1D Sliced Optimal Transport:- Samples
$N = 12,000$ interior stroke particles weighted by$1 + 2|d(\mathbf{x})|/4$ viacollima-compatibleRng64(Xorshift64* with0nXOR guard), partitioned into semantic character-to-word groups via Hamilton apportionment, solved over$K = 20$ golden-angle 1D projections$\theta_m \in [0, \pi)$ + 32-bit unsigned Morton Z-order bijection (0.00 pxexact endpoint residual at$x = 0.0$ and$x = 1.0$ , zero$O(N^2)$ dense matrix).
- Samples
-
Divergence-Free Curl-Noise Ink Ribbons & 3-Formant (
F1/F2/F3) Whisper Synthesis:- Continuous phase field $\mathbf{X}i(x, t) = (1 - s(x))\mathbf{p}i + s(x)\mathbf{q}{\pi(i)} + A{\text{curl}}\sin^2(\pi x)\nabla^\perp\psi(\bar{\mathbf{x}}_i, t)$ drives
12,000instanced horsehair brush ribbons and a gesture-gatedAudioWorklet(Paul Kellet pink noise + zero-DC Rosenberg glottal pulse with 6-tone Chao contours) through3parallel bandpassBiquadFilterNodes interpolating[320, 2150, 2900] → [520, 1350, 2450] → [680, 1120, 2550] Hz.
- Continuous phase field $\mathbf{X}i(x, t) = (1 - s(x))\mathbf{p}i + s(x)\mathbf{q}{\pi(i)} + A{\text{curl}}\sin^2(\pi x)\nabla^\perp\psi(\bar{\mathbf{x}}_i, t)$ drives
| # | Traditional Chinese | Cantonese Jyutping | English Rendering | Semantic Gloss |
|---|---|---|---|---|
| 1 | 見步行步 | gin3 bou6 hang4 bou6 |
NAVIGATE BY WALKING | Improvisational HK agency: charting terrain in motion. |
| 2 | 獅子山下 | si1 zi2 saan1 haa6 |
BENEATH LION ROCK | Collective resilience under Kowloon's granite ridge. |
| 3 | 霓虹殘影 | ngai4 hung4 caan4 jeng2 |
NEON AFTERIMAGE | Vanishing calligraphic street signage in retinal memory. |
| 4 | 山海之間 | saan1 hoi2 zi1 gaan1 |
BETWEEN PEAK & TIDE | Vertical urbanism compressed between peak and harbour. |
| 5 | 聲氣相通 | seng1 hei3 soeng1 tung1 |
SHARED BREATH & TONE | Code-switching prosody linking Cantonese tones & rhythm. |
-
Horizontal Cursor Scrub / Slider: Sweep continuous phase
$x \in [0, 1]$ (0.00Cantonese Calligraphy ↔0.50Curl-Noise Ribbons ↔1.00Swiss English Grid). -
Keys
1–5: Switch between the 5 Hong Kong Cantonese-English idioms. -
Key
P/?print=1: Toggle[P]Archival Xuan Paper Print Mode (#F7F4ECground,100%HUD chrome hidden;Escapeexits). -
Key
M/ Audio Pill: Unlock or mute/resume procedural 3-formant whisper synthesis. -
Key
Space: Toggle autonomous breathing phase drift. -
Query Parameters:
?lang=en|zh-HK(defaulten),?seed=<u64>(default1468),?preset=1..5,?phase=0..1,?print=1,?fbo=rgba8.
npm ci
npm run test:unit # 11 Node 24 unit tests (HK idioms, 3-formant, Curl-Noise, Rng64, 1D Sliced OT)
npm run build # Strict TypeScript check + relative-base Vite production bundle -> dist/
npm run preview # Serve production dist/ locally| Work | Title | Medium & Algorithms | Live Interactive Work |
|---|---|---|---|
| 01 | MORPHOS // 菌脈・聲場 | WebGL2 Gray-Scott PDE · 262k GPU Physarum · Async PBO AudioWorklet · [V] 3D Gallery |
Launch ↗ |
| 02 | CAUSTIC COLLIMATION // 光軸與焦散 | WebGL2 3D Implicit SDF Optical Bench · Snell/TIR · 7-Band Cauchy · Beating Overtone Prism | Launch ↗ |
| 03 | POLYGLOT DRIFT // 語流・字陣 (this repo) | Zero-Asset HK CJK Canvas2D · WebGL2 1+JFA SDF · O(KN log N) Sliced OT · 3-Formant Audio |
Launch ↗ |
| 04 | COLLIMA // Seeing Before the ISP | Rust 2024 + WebAssembly · 14-Bit Synthetic .DNG · Pre-Demosaic WLS Tilt & HCG Noise Lab |
Launch ↗ |