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

Improve font appearance on non-Ubuntu Linux desktops #1225

Merged
merged 6 commits into from
Jun 18, 2024

Conversation

reinhart1010
Copy link
Contributor

@reinhart1010 reinhart1010 commented Jun 14, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • New feature or enhancement
  • UI change (please include screenshot!)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Internationalization and localization
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

This PR modifies the CSS system font stack to accommodate Linux desktops other than Ubuntu.

  • GNOME defines Cantarell as their system font
  • Cinnamon (as in Linux Mint) and KDE defines Noto Sans as their system font

Other Linux desktops tend to use the de-facto system sans-serif font as commonly set in fontconfig: DejaVu Sans. But that is now subject to change, as major Linux distributions swapped the fonts in favor of Noto Sans (and Serif and Mono, as well).

This new font-stack feature Noto Sans as a fallback DE (desktop environment)-neutral font for Linux. Even though I am unable to test due to #1224, the resulting effect should be similar to the ones at https://reinhart1010.id/browser-test as I have researched about these system font stacks.

Cantarell

Font Preview in Cantarell

Noto Sans

Font Preview in Noto Sans

Ubuntu

Font Preview in Ubuntu |

Other information

Quality check

Before creating this PR:

  • Did you follow the code style guideline as described in CONTRIBUTING.md
  • Did you build the app and test your changes?
  • Did you check for accessibility? On Windows, you can use Accessibility Insights for this.
  • Did you verify that the change work in Release build configuration
  • Did you verify that all unit tests pass
  • If necessary and if possible, did you verify your changes on:
    • Windows
    • macOS
    • Linux

@reinhart1010 reinhart1010 changed the title Improve font Improve font appearance on non-Ubuntu Linux desktops Jun 14, 2024
@reinhart1010
Copy link
Contributor Author

I have gotten the builds running. This is DevToys on Fedora Linux (without the Ubuntu font installed) looks like. Noto Sans is used (as defined in system-ui but some parts of the UI (including the search bar) uses a monospaced font instead.

image

And this is in Cantarell.

image

I found out the font weight combinations are not suitable for Noto Sans and Cantarell

    --text-weight-normal: 300;
    --text-weight-bold: 400;
    --text-weight-bolder: 600;

So I changed it to 400/600/700 for best results:

image

The monospaced font bug still exist on Noto Sans, though.

image

@veler
Copy link
Collaborator

veler commented Jun 18, 2024

It looks good to me, thank you for this contribution! :)

@veler veler merged commit 89be76a into DevToys-app:main Jun 18, 2024
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants