git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix default font scaling

From
Serhii Tereshchenko <serg.partizan@gmail.com>
Date
Jun 21, 2024, 07:18 UTC
Message-ID
<3M5FFS.HXL15VW2HPOG1@gmail.com>
In-Reply-To
<0c845460-c211-48e6-af93-a0b483817420@kdbg.org>

On Fri, Jun 21 2024 at 00:04:50 +02:00:00, Johannes Sixt <j6t@kdbg.org> wrote:

Show 74 quoted lines
> Am 20.06.24 um 20:11 schrieb Serhii Tereshchenko:
>>  Yeah, I'm also testing this way.
>> 
>>  No, fonts should not be independent from DPI, but now some fonts are
>>  scaling just like the others.
>> 
>>  To clearly see the result, set comfortable DPI, so fonts are 
>> reasonably
>>  sized (if this value is close to 96, better use something larger, 
>> like
>>  130 or 200 to see the effect).
>> 
>>  When you run "git-gui" from the master branch, look at the fonts 
>> for:
>> 
>>  - menubar and menu (explicitly set, scaled with DPI - our baseline)
>>  - buttons in the lower part (Commit, Rescan, etc), labels like 
>> "Current
>>  branch" - (unscaled, visibly smaller than menubar)
>>  - you can also open "Edit -> Options", and everything there will be
>>  smaller size as well.
>> 
>>  After applying patch, all fonts are scaled equally (e.q. - small 
>> DPI -
>>  everything small, large DPI - everything big).
>> 
>>  If, however - you see second behavior on both cases, I'm really
>>  interested to get more details:
> 
> I see the second behavior regardless of the patch, i.e. with small DPI
> all fonts are small, with large DPI all fonts are large.
> 
> The label "Current branch" is the same size as other fonts except 
> when I
> select a different font size in Edit->Options as "Main Font".
> 
> 
>>  - What OS and Tcl/Tk are you using?
>> 
>>  I remember few years ago it worked fine on my ArchLinux, so if other
>>  distros aren't updated something yet, it may still work.
>> 
>>  On Arch we have Tcl/Tk 8.6.14.
>> 
>>  And to go even deeper, we may compare results from `wish`:
>> 
>>>  package require Tk 8.5
>>  8.6.14
>>>  font configure TkDefaultFont
>>  -family sans-serif -size -12 -weight normal -slant roman -underline 
>> 0
>>  -overstrike 0
>>>  font actual TkDefaultFont
>>  -family {Nokia Sans S60} -size 9 -weight normal -slant roman 
>> -underline
>>  0 -overstrike 0
> 
> I have this:
> 
> % package require Tk 8.5
> 8.6.12
> % font configure TkDefaultFont
> -family sans-serif -size -12 -weight normal -slant roman -underline 0
> -overstrike 0
> %
> % font actual TkDefaultFont
> -family Arial -size 9 -weight normal -slant roman -underline 0 
> -overstrike 0
> %
> 
> I am using openSUSE Leap 15.5 under KDE Frameworks 5.103.0
> 
> -- Hannes
> 

Thanks! I tried booting into Fedora/37 with the same Tk version, and it indeed does not have this scaling problem.

Then, I downgraded packages on Arch to 8.6.12 and 8.6.13 - also no problem.

The only version affected is 8.6.14.

That's probably a bug in Tk (and there's quite a few reported, mostly about "tk scaling" https://core.tcl-lang.org/tk/info/1de3a48312, we don't use it explicitly in git-gui but on my system it is set to 1.3)

Previous: Johannes SixtNext: Johannes Sixt
Message 8 of 12 in “Fix default font scaling”
  1. Fix default font scalingSerhii Tereshchenko, Jun 15, 2024
  2. Eric SunshineJun 15, 2024
  3. Johannes SixtJun 16, 2024
  4. Serhii TereshchenkoJun 16, 2024
  5. Johannes SixtJun 20, 2024
  6. Serhii TereshchenkoJun 20, 2024
  7. Johannes SixtJun 20, 2024
  8. Serhii TereshchenkoJun 21, 2024
  9. Johannes SixtJun 23, 2024
  10. serg.partizan@gmail.comJun 23, 2024
  11. serg.partizan@gmail.comJun 23, 2024
  12. Johannes SixtJun 23, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.