Skip to content

✨ add text measurement helpers#30

Draft
rauhryan wants to merge 3 commits into
mainfrom
rr/text-measurement-helpers
Draft

✨ add text measurement helpers#30
rauhryan wants to merge 3 commits into
mainfrom
rr/text-measurement-helpers

Conversation

@rauhryan
Copy link
Copy Markdown
Collaborator

@rauhryan rauhryan commented May 9, 2026

Summary

  • add pure TypeScript text measurement helpers exported from mod.ts
  • port the renderer wcwidth table to TypeScript so helper widths match renderer layout for zero-width/default-ignorable codepoints
  • document helper API and large-input behavior in specs/renderer-spec.md
  • normalize oversized text packing failures to descriptive RangeError messages
  • add coverage for wrap modes, Unicode widths, no-WASM/no-UTF8-staging measurement, default-ignorable width handling, and large UTF-8 projection rendering
  • merge latest upstream main into the PR branch

Test

  • scripts/run-checks 30 --include-uncommitted

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/clayterm@30

commit: c099165

@cowboyd
Copy link
Copy Markdown
Collaborator

cowboyd commented May 9, 2026

I'm a bit worried that these measurement helpers present a completely different code path than the actual algorithm that clay uses to layout text. This could be a totally separate library.

@rauhryan rauhryan marked this pull request as draft May 10, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants