Skip to content

Consistently pass through the root style for empty text - #721

Merged
tomcur merged 1 commit into
linebender:mainfrom
tomcur:push-vvpozqksmsok
Jul 31, 2026
Merged

Consistently pass through the root style for empty text#721
tomcur merged 1 commit into
linebender:mainfrom
tomcur:push-vvpozqksmsok

Conversation

@tomcur

@tomcur tomcur commented Jul 30, 2026

Copy link
Copy Markdown
Member

On top of #720, as otherwise that code hits an underflow.

Empty text still needs a style, e.g., to be able to size cursors. This PR plumbs the root style through. I hit this when making font selection infallible, which tripped up the builders_empty test.

(This might also be useful for sizing "struts".)

Because with this change these empty layouts now actually have a style, that means font selection now succeeds in the builders_empty test, where it previously failed. Not having a font was the only reason there weren't any runs in the changed test, because, for empty text, parley actually shapes a space character, which should lead to a run.

I've chosen to remove checking that runs are empty from the test, as I think it's mostly checking the wrong thing at the moment. If we ever stop synthesizing a space character for empty text, we should revisit this.

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we ought to do something more principled here, but happy to go with this for now.

Empty text still needs to be able to size cursors, I hit this when
making font selection infallible, which tripped up `builders_empty`.

(This might also be useful for sizing "struts".)
@tomcur
tomcur force-pushed the push-vvpozqksmsok branch from d2a5413 to 0dab6da Compare July 31, 2026 08:35
@tomcur
tomcur added this pull request to the merge queue Jul 31, 2026
Merged via the queue into linebender:main with commit 78de830 Jul 31, 2026
24 checks passed
@tomcur
tomcur deleted the push-vvpozqksmsok branch July 31, 2026 08:51
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