feat(bindings): Text::set_style in python, java, objective-c and the npm package - #898
Merged
Conversation
andiwand
force-pushed
the
feat/format-editor
branch
from
September 13, 2026 16:53
55e5cbf to
126d77d
Compare
…npm package Python binds `Text.set_style(TextStyle)` as it stands. Java and Objective-C get the same, with `TextStyle` constructible and its fields writable, so a caller builds the delta it passes; a `fontName` is refused before it reaches C++, since the C++ one borrows from a document. The npm package's `setTextStyle(id, style)` takes the page's style object and replays it through the envelope, so the wire's parser validates it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137vd79NGaB8nfLsdPoghM4
andiwand
force-pushed
the
feat/bind-set-style
branch
from
September 13, 2026 17:19
83d3ab6 to
c135834
Compare
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.
🤖 Generated with Claude Code
The last step of the inline formatting plan. Rebased onto main after #897 merged.
Text.set_style(TextStyle).TextStylewas already constructible with writable fields.Text.setStyle(TextStyle).TextStylegets a public no-arg constructor and writable fields, so a caller builds the delta it passes; the native side reads the non-null fields, a Java enum by ordinal. AfontNamerefuses withUnsupportedOperationbefore it reaches C++, since the C++ one borrows from a document.-[ODRText setStyle:error:].ODRTextStylegets a publicinitand readwrite properties;-handlein the private category unboxes them, and afontNamerefuses the same way.Document.setTextStyle(id, style)takes the page's style object, typed asTextStyleinindex.d.ts, and replays it through the edit envelope, so the wire's parser validates it and an unknown property is anOdrError.Verified on this machine after the rebase: python 83 passed (one new); JUnit 63 successful (one new); wasm node suite 50 passed (two new); the macOS slice built for both archs and
swift testpassed with the two new cases. The JNI and python binding sources are clean under Homebrew clang-Wall -Wextra -Werror.docs/design/document-editing.mdmarks the plan landed. Changelog entry added.