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 control of line height and letter spacing #3302

Merged
merged 8 commits into from
Sep 5, 2023

Conversation

emilk
Copy link
Owner

@emilk emilk commented Sep 4, 2023

Line height can now be explicitly overridden, and the spacing between letter adjusted.

They can be set in the low-level epaint::TextFormat or the high-level egui::RichText.

Both are set in points, but for even kerning you should round to pixels.

You can see both in action in the new "Text Layout" demo (using integer pixels rather than points for the ui):

line-height
letter-spacing

Copy link
Collaborator

@abey79 abey79 left a comment

Choose a reason for hiding this comment

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

Nice!

crates/egui/src/widget_text.rs Outdated Show resolved Hide resolved
@emilk emilk merged commit 46ea72a into master Sep 5, 2023
34 checks passed
@emilk emilk deleted the emilk/letter-spacing-and-line-height branch September 5, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for custom line_height and letter_spacing
2 participants