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

Fix text sizes being too small #2069

Merged
merged 5 commits into from Sep 21, 2022
Merged

Fix text sizes being too small #2069

merged 5 commits into from Sep 21, 2022

Commits on Sep 21, 2022

  1. Fix text sizes being too small

    Closes #2068
    
    Before this PR, the default font, Ubuntu-Light, was ~11% smaller
    than it should have been, and the default monospace font, Hack,
    was ~14% smaller. This means that setting the font size `12` in egui
    would yield smaller text than using that font size in any other app.
    Ooops!
    
    The change is that this PR now takes into account the ttf properties
    `units_per_em` and `height_unscaled`.
    
    If your egui application has specified you own font sizes or text styles
    you will see the text in your application grow
    larger, unless you go in and compensate by dividing all font sizes by
    ~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace,
    and with something else if you are using a custom font!
    This effects any use of `FontId`, `RichText::size`, etc.
    
    This PR changes the default `Style::text_styles` to compensate,
    so the default egui style should look the same before and after this PR.
    emilk committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    76a686d View commit details
    Browse the repository at this point in the history
  2. Update changelogs

    emilk committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    0eedbaf View commit details
    Browse the repository at this point in the history
  3. tweak emoji scaling

    emilk committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    cb30a9a View commit details
    Browse the repository at this point in the history
  4. fix test

    emilk committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    2eac15a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b33e04b View commit details
    Browse the repository at this point in the history