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

Add per-range support for line height #86

Open
gskinner opened this issue Dec 14, 2020 · 0 comments
Open

Add per-range support for line height #86

gskinner opened this issue Dec 14, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@gskinner
Copy link
Collaborator

Line height is a multiplier in Flutter, and is calculated per line based on the largest text in the line. In XD it is a fixed value for all lines in a field. This may result in significant differences when displaying multiline text having multiple text sizes.

It may be possible to improve on this by calculating a line height for each TextSpan individually, though it would require knowing what the "default" line height is.

Ex.
spanHeight = (xdNode.lineSpacing ?? _calculateDefaultHeight()) / (span.fontSize)

The unknown is calculating the default height if linespacing is 0. It would also be nice to use that to omit the line spacing code if a range is using the default.

@gskinner gskinner added the enhancement New feature or request label Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant