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

feature request: Add text justification #76

Closed
notgull opened this issue Feb 18, 2023 · 4 comments
Closed

feature request: Add text justification #76

notgull opened this issue Feb 18, 2023 · 4 comments

Comments

@notgull
Copy link
Contributor

notgull commented Feb 18, 2023

I am currently developing a cosmic-text-based implementation of the piet text API, see here. The only bits from piet that are currently unimplemented are variable font sizes (already raised in #64) and text justification.

piet expects there to be utilities for text justification, with start (default), right, center and justified alignments. See this enum for more information.

Are there any plans to add text alignment to cosmic-text?

@grovesNL
Copy link
Contributor

On the iced Discord (under discussions/Advanced Text Handling) we briefly discussed adding justification and alignment to cosmic-text's Attrs.

It's possible to work around it after layout has already happened by shifting glyphs around in the final layout line (I use this technique for centering text currently), but obviously that's not ideal.

@notgull notgull mentioned this issue Feb 23, 2023
5 tasks
@notgull
Copy link
Contributor Author

notgull commented Feb 24, 2023

Closed by #78

@notgull notgull closed this as completed Feb 24, 2023
@jackpot51
Copy link
Member

I think the system @hojjatabdollahi designed that each buffer line has alignment works best. It matches what was done for wrapping, since we cannot do spans of test inside a paragraph with different alignment as far as I know.

@jackpot51
Copy link
Member

If there are concerns with that implementation, please open another issue.

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