Skip to content

Bump parley from 0.9.0 to 0.10.0 and expose complex-scripts feature (#24094)#24683

Open
unclepomedev wants to merge 2 commits into
bevyengine:mainfrom
unclepomedev:main
Open

Bump parley from 0.9.0 to 0.10.0 and expose complex-scripts feature (#24094)#24683
unclepomedev wants to merge 2 commits into
bevyengine:mainfrom
unclepomedev:main

Conversation

@unclepomedev

Copy link
Copy Markdown

Objective

Fixes #24094

Text containing complex scripts that lack explicit word boundaries (CJK, Thai, Khmer, Lao, Myanmar) is segmented by parley's lightweight segmenter, which emits a data error per layout:

ICU4X data error: No segmentation model for language: ja

parley 0.10 added a complex-scripts Cargo feature that switches to dictionary-based segmentation, but bevy_text, bevy_ui, and bevy_ui_widgets were still pinned to parley 0.9, so it was not reachable from Bevy.

Solution

  • Bump parley from 0.9 to 0.10 in bevy_text, bevy_ui, and bevy_ui_widgets. All three are bumped together so the graph resolves to a single parley version instead of duplicating 0.9 + 0.10.
  • Add an opt-in complex_script_segmentation feature to bevy_text that forwards to parley/complex-scripts, propagated through bevy_internal and bevy. It is off by default because the bundled segmentation dictionary increases binary size.

This supplies the segmentation data and enables dictionary-based word segmentation; it does not change CJK line-break positions, which ICU keeps permissive by design.

Testing

  • cargo build -p bevy_text -p bevy_ui -p bevy_ui_widgets, with default features and with --features complex_script_segmentation.
  • cargo tree -i parley confirms a single parley 0.10 in the graph (no 0.9/0.10 duplication).
  • cargo tree -e features -i parley confirms parley's complex-scripts feature is only enabled when complex_script_segmentation is requested (not pulled in by any default/collection feature).
  • Ran a Text2d example with a Japanese string in a width-bounded box (TextBounds, LineBreak::WordBoundary) under RUST_LOG=warn:
    • default: the No segmentation model for language: ja error is logged.
    • --features complex_script_segmentation: the error is gone.
  • cargo run -p ci (lints + compile + tests). One unrelated local failure: bevy_ecs ... filtered_backtrace_test, which also fails on main on my machine (an environment-dependent backtrace-symbolization test, unrelated to this PR).
  • Tested on macOS (Apple Silicon).

@github-actions

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@mnmaita mnmaita added C-Dependencies A change to the crates that Bevy depends on A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Dependencies A change to the crates that Bevy depends on D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICU4X data error: No segmentation model for language: ja when updating CJK characters

2 participants