Skip to content

avm2: Create a FormatSpans for the text block's content element in createTextLine - #24351

Merged
Lord-McSweeney merged 2 commits into
ruffle-rs:masterfrom
Lord-McSweeney:avm2-textblock-spans
Aug 2, 2026
Merged

avm2: Create a FormatSpans for the text block's content element in createTextLine#24351
Lord-McSweeney merged 2 commits into
ruffle-rs:masterfrom
Lord-McSweeney:avm2-textblock-spans

Conversation

@Lord-McSweeney

Copy link
Copy Markdown
Member

Description

Instead of accessing the text of the content element using a getter, create a full FormatSpans for the content element. Currently we discard most of the useful information from it, so this PR shouldn't significantly affect real-world content much. However, this PR does also fix code that uses GroupElement to create lines, so it makes some content (e.g. w2w) render correctly now.

Testing

I'm not adding tests in this PR as it's just an intermediate step to better FTE support. In my next 1-2 PRs, I'll add comprehensive tests for FTE and TLF text rendering.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

@Lord-McSweeney Lord-McSweeney added A-avm2 Area: AVM2 (ActionScript 3) fte/tlf Issues relating to the FTE (Flash Text Engine) AVM2 API or the TLF (Text Layout Framework) library T-refactor Type: Refactor / Cleanup labels Aug 2, 2026
Comment thread core/src/avm2/globals/flash/text/engine/text_block.rs
@Lord-McSweeney
Lord-McSweeney merged commit 5b6f666 into ruffle-rs:master Aug 2, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) fte/tlf Issues relating to the FTE (Flash Text Engine) AVM2 API or the TLF (Text Layout Framework) library T-refactor Type: Refactor / Cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants