Skip to content

Conversation

juanruitina
Copy link

@juanruitina juanruitina commented Sep 30, 2025

Some fixes for better consistency with GTK and better typography.

GTK points vs Flutter pixels

GTK uses points (pt) as units, whereas Flutter uses dp (~pixels). Default text in the Yaru GTK theme is 11pt, which translate into 14.66...dp as opposed to 14dp that we are currently using. Conversion is dp = pt * (96 / 72).

This is not only a cosmetic change: text was unnecessarily small compared to GTK apps.

I went for a hardcoded value, rounding two decimals, but we could obvs do the calculation with a function:

double ptToPx(double points) {
  return points * 96 / 72;
}

Unnecessary letter spacing

Current styles seem to be inheriting some letter spacing from Material/Flutter. This letter spacing is unnecessary and inconsistent with Yaru GTK.

I checked with @lyubomir-popov, visual designer at Canonical heavily involved in the development of Ubuntu Sans. Letter spacing is only acceptable for small caps or uppercase. My fix sets it to zero for all font styles. This results in a slightly higher density, good in some instances such as the sidebar (see #1035)

Before After
Screenshot From 2025-09-30 13-20-52 Screenshot From 2025-09-30 13-19-56

Related: #995

@juanruitina juanruitina changed the title Align text with Yaru GTK: fix default font size and remove letter spacing style: Align text with Yaru GTK: fix default font size and remove letter spacing Sep 30, 2025
@juanruitina juanruitina changed the title style: Align text with Yaru GTK: fix default font size and remove letter spacing style: Tweak default font size to match Yaru GTK and remove letter spacing Sep 30, 2025
juanruitina and others added 4 commits September 30, 2025 12:11
Increase in text size requires a slightly less dense VisualDensity
@Feichtmeier Feichtmeier changed the title style: Tweak default font size to match Yaru GTK and remove letter spacing fix: Tweak default font size to match Yaru GTK and remove letter spacing Sep 30, 2025
@Feichtmeier
Copy link
Member

@juanruitina thanks for your work 🧑‍💻 👨🏻‍🎨

You migh also want to check @Muqtxdir 'PR #996

Copy link
Member

@Jupi007 Jupi007 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

The letter spacing is clearly visible between the "tofu" on the previous version of the golden images. I've always found that strange, I didn't think it was related to letter spacing 😅

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.

4 participants