Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose text measurement during layout phase #52

Closed
cmyr opened this issue Jun 12, 2019 · 3 comments
Closed

expose text measurement during layout phase #52

cmyr opened this issue Jun 12, 2019 · 3 comments

Comments

@cmyr
Copy link
Member

cmyr commented Jun 12, 2019

Currently text measurement is only possible once a handle to the RenderCtx is available, which is only in the paint fn. To do layout correctly, we need to be able to measure text in the layout fn. Not sure exactly how this should be plumbed, but it is currently preventing us from properly implementing most text-focused widgets.

@SimonSapin
Copy link

Would linebender/piet#47 affect this?

@raphlinus
Copy link
Contributor

Yes, these overlap. We need some Rust type other than a piet RenderCtx that's capable of doing text layout. Ideally you'd be able to take the text layout object from that and draw it in a RenderCtx. As in piet#47, we need to figure out what operations this is capable of. We also need to figure out whether this should simply be part of piet, or split out into a separate crate, as it's not hard to imagine there's value in doing text formatting without it being tied to piet drawing.

@raphlinus
Copy link
Contributor

Close this? There are a whole bunch of text improvements in the pipeline, but I think the core issue here has been addressed.

@cmyr cmyr closed this as completed Aug 7, 2019
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

No branches or pull requests

3 participants