Re: [PATCH] Fix default font scaling
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 15, 2024, 16:32 UTC
- Message-ID
- <CAPig+cSRkAFu8hnCDT_Fcih9kpiJXsmHZLTdAEdHYjS94wntYA@mail.gmail.com>
- In-Reply-To
- <20240615085345.47278-1-serg.partizan@gmail.com>
On Sat, Jun 15, 2024 at 4:54 AM Serhii Tereshchenko <serg.partizan@gmail.com> wrote:
Show 9 quoted lines
> This fixes font scaling for default fonts, where we don't set font > sizes explicitly. > > Without this, on 4k monitor with text-scaling-factor configured in Gnome, > labels, buttons and settings are using very small font sizes. (Probably, > not just Gnome but anything that sets custom DPI). > > Signed-off-by: Serhii Tereshchenko <serg.partizan@gmail.com> > ---
I'm adding Johannes Sixt <j6t@kdbg.org>, the new git-gui maintainer[*], to the Cc: list.
[*]: https://lore.kernel.org/git/0241021e-0b17-4031-ad9f-8abe8e0c0097@kdbg.org/
Show 6 quoted lines
> diff --git a/git-gui.sh b/git-gui.sh
> @@ -810,6 +810,16 @@ if {[is_Windows]} {
> +# For whatever reason, Tk does not apply font scaling to default fonts,
> +# but applies font scaling when setting size explicitly.
> +# Default -size 10 is still 10, when you look at it with `font actual ...`,
> +# but explicitl -size 10 becomes 10 * scale factor.s/explicitl/explicit/
> +# So, we need to configure fonts to use their default font sizes, but scaled.
> +foreach font_name [font names] {
> + font configure $font_name -size [font actual $font_name -size]
> +}