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

FormattedText size and text decorations #56

Open
schenney-chromium opened this issue Nov 17, 2023 · 0 comments
Open

FormattedText size and text decorations #56

schenney-chromium opened this issue Nov 17, 2023 · 0 comments

Comments

@schenney-chromium
Copy link
Contributor

FormattedText provides a width/height of the line, which has two potential meanings in the presence of text decorations like shadows, underlines etc.

In standard web contexts, text decorations do not contribute to text size for the purposes of computing overflow (scrollbars) or otherwise have any impact on how the text is laid out. This is an important principle: text decorations do not affect layout. This argues for not including decorations in the metrics, if only because it would make it possible to reproduce standard HTML line layout when rendered.

But when rendering lines in a canvas, maybe you want to know how much bigger the painted area is when shadows and decorations are applied. In particular, you may wish to prevent visual overlap. Such information could be provided; it is the ink overflow.

The obvious options are to define it as one or the other, or provide both, or make it a parameter. I lean toward defining it as the scrollable overflow size.

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

1 participant