Repository navigation
Use WebAssembly.instantiate in the browser - #9
Closed
Liamolucko wants to merge 4 commits into
Closed
Liamolucko wants to merge 4 commits into
Liamolucko wants to merge 4 commits into
Conversation
Collaborator
|
I kinda liked the idea of having it run in another thread, but i guess people can still just move it to a WorkerThread. |
Collaborator
|
merged in 23e4081 |
matmen
added a commit
that referenced
this pull request
Oct 16, 2026
Groundwork for text in any script, not used by renderText yet: - scripts/unicode.js generates src/render/unicode-data.ts from the Unicode Character Database 18.0 (general category, combining class, bidi class, brackets and mirroring, line break, East Asian width, script, grapheme break, Indic conjunct break, Extended_Pictographic, Indic syllabic/positional categories, joining type): varint encoded ranges in base64, 67 kB (27 kB gzipped), decoded when first used (src/render/unicode.ts) - src/render/bidi.ts: UAX #9, written after the specification (P2-P3, X1-X10, W1-W7, N0 brackets, N1-N2, I1-I2, L1-L2); passes all 770,241 BidiTest.txt and 91,707 BidiCharacterTest.txt cases - src/render/linebreak.ts: UAX #14 revision 57 (LB1-LB31, LB15a-d, LB20a, LB21a-b, LB28a, LB30a-b); passes all 19,346 LineBreakTest.txt cases - tests/unicode.js runs samples of the three conformance files - Unicode License v3 in licenses/ and THIRD_PARTY_NOTICES.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJgRK5qpwJEbHPuFv6kgAQ
matmen
added a commit
that referenced
this pull request
Oct 17, 2026
…rapping A port of HarfBuzz 14.6's OpenType shaping (Old MIT, credited in the file headers and THIRD_PARTY_NOTICES.md): - buffer.ts: the in/out buffer with HarfBuzz's cluster merging - layout.ts: GDEF, script/language/feature selection with feature variations at the default instance, the feature map with stages and masks, every GSUB (1-8) and GPOS (1-9) lookup type with HarfBuzz's matching (ZWJ/ZWNJ, per-syllable, ligature components, mark attachment to ligature components, cursive chains) - shape.ts: unicode properties, dotted circles, native direction, mirroring, normalization (decompose/reorder/recompose by what the font has), fractions, space fallback, kern table, fallback mark positioning, default ignorables - shapers: Arabic (with presentation-form fallback and stch), Hebrew, Thai/Lao, Hangul, Indic, Khmer, Myanmar and the Universal Shaping Engine, their syllable grammars as longest-match NFA scanners - scripts/unicode.js also generates the Indic/USE categories (after HarfBuzz's generators, with Microsoft's USE data in scripts/ms-use), canonical decompositions, Arabic presentation forms, vowel constraints; property values are translated to short names Identical to HarfBuzz (glyphs, clusters, positions) on the UDHR in 29 scripts, ~300,000 random sequences over 30 Noto fonts, 15,000 emoji sequences in the color test fonts and 12,000 with the Latin test fonts. renderText now analyzes each paragraph (UAX #9 levels, UAX #29 graphemes for font fallback, script itemization with paired brackets, UAX #14 break opportunities), shapes runs of one level, script and font with surrounding context, wraps at break opportunities (graphemes for char wrapping and overlong words), and shapes and reorders every line by itself (L1/L2). Hinted glyphs keep their hinted advances with the positioning's adjustments rounded cumulatively. The old GSUB and GPOS kerning code is removed. Tests: tests/shaping.js compares 360 texts with HarfBuzz's output for subsets of Noto fonts (scripts/shaping-reference.py), tests/unicode.js adds GraphemeBreakTest, tests/font.js a bidirectional render test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJgRK5qpwJEbHPuFv6kgAQ
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.
WebAssembly.instantiate()compiles the WebAssembly on another thread, meaning you don't have to use aWorker.