Switch Thai font from Sarabun to Boon and refactor cell coloring - #26
Closed
narze wants to merge 1 commit into
Closed
Switch Thai font from Sarabun to Boon and refactor cell coloring#26narze wants to merge 1 commit into
narze wants to merge 1 commit into
Conversation
Replace self-hosted Sarabun with Boon — the modified Thai face manoontype ships — served as a single self-hosted 400 weight (heavier UI text synthesises bold from it, exactly as manoontype does). With Boon's full GPOS mark positioning, the active word goes back to the manoontype model: one cell per code point, each lighting the instant it is typed (correct / wrong / pending), caret between code points. Because the cells stay display:inline, Boon shapes the whole word as one run and stacks every tone mark / vowel onto its base — even when a mark and its base carry different colours (ที่, not ที). This drops the per-cluster "light only when fully typed" workaround, so a base no longer waits on its vowel to light, and a vowel never looks typed the instant its base is pressed. Verified in headless Chromium: typing บ with a pending ี renders the ี muted but stacked on a lit บ, no dotted circles. https://claude.ai/code/session_01Gizdi8AgrkJ2JiGMEdPPpw
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the Sarabun font with Boon (a modified Thai face from manoonchai/manoontype) and refactors the typing flow cell coloring logic to match manoontype's per-keystroke highlighting behavior.
Key Changes
Font Migration: Replaced Sarabun with self-hosted Boon font
@font-facedeclaration for Boon-400.woff2 with GPOS mark positioning supportapp.css,result-card.ts, and+layout.svelte@fontsource/sarabundependencyCell Coloring Refactor: Changed from cluster-based to code-point-based coloring
clustersOf()dependency and cluster iteration logicTest Updates: Updated test expectations to reflect per-keystroke coloring
Implementation Details
The refactored
activeCellslogic now iterates through target code points directly rather than grapheme clusters. Each code point's color is determined by:CURRENT_PENDING: Not yet reached in inputCORRECT: Input matches the expected code pointWRONG: Input differs from expected code pointBoon's GPOS mark positioning ensures Thai combining marks still stack correctly onto their base consonants despite being in separate inline
<span>elements, enabling proper per-keystroke visual feedback.https://claude.ai/code/session_01Gizdi8AgrkJ2JiGMEdPPpw