{"thread":{"id":"61635","subject":"[PATCH] Fix default font scaling","startedAt":"2024-06-15T08:54:00Z","lastAt":"2024-06-23T15:50:52Z","messageCount":12,"participants":["Serhii Tereshchenko","Eric Sunshine","Johannes Sixt","serg.partizan@gmail.com"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"497206","messageId":"20240615085345.47278-1-serg.partizan@gmail.com","threadId":"61635","inReplyTo":null,"subject":"[PATCH] Fix default font scaling","fromName":"Serhii Tereshchenko","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-15T08:53:39Z","receivedAt":"2024-06-15T08:54:00Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"This fixes font scaling for default fonts, where we don't set font\nsizes explicitly.\n\nWithout this, on 4k monitor with text-scaling-factor configured in Gnome,\nlabels, buttons and settings are using very small font sizes. (Probably,\nnot just Gnome but anything that sets custom DPI).\n\nScreenshots here: https://twiukraine.com/@partizan/112619567918546426\n\nSigned-off-by: Serhii Tereshchenko <serg.partizan@gmail.com>\n---\n git-gui.sh | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 8bc8892..23dd82d 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -810,6 +810,16 @@ if {[is_Windows]} {\n ## config defaults\n \n set cursor_ptr arrow\n+\n+# For whatever reason, Tk does not apply font scaling to default fonts,\n+# but applies font scaling when setting size explicitly.\n+# Default -size 10 is still 10, when you look at it with `font actual ...`,\n+# but explicitl -size 10 becomes 10 * scale factor.\n+# So, we need to configure fonts to use their default font sizes, but scaled.\n+foreach font_name [font names] {\n+\tfont configure $font_name -size [font actual $font_name -size]\n+}\n+\n font create font_ui\n if {[lsearch -exact [font names] TkDefaultFont] != -1} {\n \teval [linsert [font actual TkDefaultFont] 0 font configure font_ui]\n-- \n2.45.2\n\n"},{"id":"497214","messageId":"CAPig+cSRkAFu8hnCDT_Fcih9kpiJXsmHZLTdAEdHYjS94wntYA@mail.gmail.com","threadId":"61635","inReplyTo":"20240615085345.47278-1-serg.partizan@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-06-15T16:32:49Z","receivedAt":"2024-06-15T16:33:02Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jun 15, 2024 at 4:54 AM Serhii Tereshchenko\n<serg.partizan@gmail.com> wrote:\n> This fixes font scaling for default fonts, where we don't set font\n> sizes explicitly.\n>\n> Without this, on 4k monitor with text-scaling-factor configured in Gnome,\n> labels, buttons and settings are using very small font sizes. (Probably,\n> not just Gnome but anything that sets custom DPI).\n>\n> Signed-off-by: Serhii Tereshchenko <serg.partizan@gmail.com>\n> ---\n\nI'm adding Johannes Sixt <j6t@kdbg.org>, the new git-gui\nmaintainer[*], to the Cc: list.\n\n[*]: https://lore.kernel.org/git/0241021e-0b17-4031-ad9f-8abe8e0c0097@kdbg.org/\n\n> diff --git a/git-gui.sh b/git-gui.sh\n> @@ -810,6 +810,16 @@ if {[is_Windows]} {\n> +# For whatever reason, Tk does not apply font scaling to default fonts,\n> +# but applies font scaling when setting size explicitly.\n> +# Default -size 10 is still 10, when you look at it with `font actual ...`,\n> +# but explicitl -size 10 becomes 10 * scale factor.\n\ns/explicitl/explicit/\n\n> +# So, we need to configure fonts to use their default font sizes, but scaled.\n> +foreach font_name [font names] {\n> +       font configure $font_name -size [font actual $font_name -size]\n> +}\n"},{"id":"497220","messageId":"5dd4de8a-255a-4f03-b4d8-fc160b3178e1@kdbg.org","threadId":"61635","inReplyTo":"20240615085345.47278-1-serg.partizan@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-06-16T10:30:51Z","receivedAt":"2024-06-16T11:17:26Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 15.06.24 um 10:53 schrieb Serhii Tereshchenko:\n> This fixes font scaling for default fonts, where we don't set font\n> sizes explicitly.\n> \n> Without this, on 4k monitor with text-scaling-factor configured in Gnome,\n> labels, buttons and settings are using very small font sizes. (Probably,\n> not just Gnome but anything that sets custom DPI).\n> \n> Screenshots here: https://twiukraine.com/@partizan/112619567918546426\n> \n> Signed-off-by: Serhii Tereshchenko <serg.partizan@gmail.com>\n\nThank you. I have adjusted the title to read\n\n  git-gui: fix scaled default fonts\n\nto follow the convention.\n\n> ---\n>  git-gui.sh | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n> \n> diff --git a/git-gui.sh b/git-gui.sh\n> index 8bc8892..23dd82d 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -810,6 +810,16 @@ if {[is_Windows]} {\n>  ## config defaults\n>  \n>  set cursor_ptr arrow\n> +\n> +# For whatever reason, Tk does not apply font scaling to default fonts,\n> +# but applies font scaling when setting size explicitly.\n> +# Default -size 10 is still 10, when you look at it with `font actual ...`,\n> +# but explicitl -size 10 becomes 10 * scale factor.\n\nI fixed this typo: s/explicitl/explict/\n\n> +# So, we need to configure fonts to use their default font sizes, but scaled.\n> +foreach font_name [font names] {\n> +\tfont configure $font_name -size [font actual $font_name -size]\n> +}\n\nHave you seen https://wiki.tcl-lang.org/page/font+scaling where [font\nconfigure ...] instead of [font actual ...] is suggested as a preferable\nsolution? I am not so much into Tcl/Tk that I can judge what is best.\n\n> +\n>  font create font_ui\n>  if {[lsearch -exact [font names] TkDefaultFont] != -1} {\n>  \teval [linsert [font actual TkDefaultFont] 0 font configure font_ui]\n\nMy setup does not have a 4k monitor, I run KDE and I do not know if I\nhave changed a DPI setting. For the test, I have removed the [gui]\nsections from my configurations to ensure that the defaults are used.\n\nUnder these conditions, this change does not make a difference in how\nGit GUI appears. I assume this is the expected outcome, so I take it as\na good sign.\n\nThe patch is available as\n\nhttps://github.com/j6t/git-gui.git st/font-scaling-fix\n\nfor others to test. I'd appreciate your feedback.\n\n-- Hannes\n\n"},{"id":"497223","messageId":"Q1B6FS.FVKOG950Y3UN@gmail.com","threadId":"61635","inReplyTo":"5dd4de8a-255a-4f03-b4d8-fc160b3178e1@kdbg.org","subject":"Re: [PATCH] Fix default font scaling","fromName":"Serhii Tereshchenko","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-16T12:37:02Z","receivedAt":"2024-06-16T12:37:10Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"\n\nOn Sun, Jun 16 2024 at 12:30:51 +02:00:00, Johannes Sixt <j6t@kdbg.org> \nwrote:\n> Am 15.06.24 um 10:53 schrieb Serhii Tereshchenko:\n>>  This fixes font scaling for default fonts, where we don't set font\n>>  sizes explicitly.\n>> \n>>  Without this, on 4k monitor with text-scaling-factor configured in \n>> Gnome,\n>>  labels, buttons and settings are using very small font sizes. \n>> (Probably,\n>>  not just Gnome but anything that sets custom DPI).\n>> \n>>  Screenshots here: \n>> https://twiukraine.com/@partizan/112619567918546426\n>> \n>>  Signed-off-by: Serhii Tereshchenko <serg.partizan@gmail.com>\n> \n> Thank you. I have adjusted the title to read\n> \n>   git-gui: fix scaled default fonts\n> \n> to follow the convention.\n> \n>>  ---\n>>   git-gui.sh | 10 ++++++++++\n>>   1 file changed, 10 insertions(+)\n>> \n>>  diff --git a/git-gui.sh b/git-gui.sh\n>>  index 8bc8892..23dd82d 100755\n>>  --- a/git-gui.sh\n>>  +++ b/git-gui.sh\n>>  @@ -810,6 +810,16 @@ if {[is_Windows]} {\n>>   ## config defaults\n>> \n>>   set cursor_ptr arrow\n>>  +\n>>  +# For whatever reason, Tk does not apply font scaling to default \n>> fonts,\n>>  +# but applies font scaling when setting size explicitly.\n>>  +# Default -size 10 is still 10, when you look at it with `font \n>> actual ...`,\n>>  +# but explicitl -size 10 becomes 10 * scale factor.\n> \n> I fixed this typo: s/explicitl/explict/\n> \nThanks!\n\n>>  +# So, we need to configure fonts to use their default font sizes, \n>> but scaled.\n>>  +foreach font_name [font names] {\n>>  +\tfont configure $font_name -size [font actual $font_name -size]\n>>  +}\n> \n> Have you seen https://wiki.tcl-lang.org/page/font+scaling where [font\n> configure ...] instead of [font actual ...] is suggested as a \n> preferable\n> solution? I am not so much into Tcl/Tk that I can judge what is best.\n> \n\nNo, I haven't seen this, but suggested preferable solution doesn't work.\n\n`font configure $font -size` returns negative numbers for me.\n\nAccording to this\nhttps://tkdocs.com/shipman/fonts.html\n\nit means \"size in pixels\". And size in pixels does not scale. So, if we \nwant fonts to scale with DPI, we should use \"points\" - and that's what \n`font actual ...` returns (i just hope it returns points, because it \nworks for me and scales like points).\n\nI'm also no expert in Tcl/Tk, this just my second time writing patches \nfor git-gui :)\n\nProbably, after all this we should change comment to:\n\n# Default Tk fonts are defined in pixels, and they\n# does not scale with DPI, here we're converting them\n# into points, allowing them to scale just like\n# explicitly defined fonts.\n\n\n>>  +\n>>   font create font_ui\n>>   if {[lsearch -exact [font names] TkDefaultFont] != -1} {\n>>   \teval [linsert [font actual TkDefaultFont] 0 font configure \n>> font_ui]\n> \n> My setup does not have a 4k monitor, I run KDE and I do not know if I\n> have changed a DPI setting. For the test, I have removed the [gui]\n> sections from my configurations to ensure that the defaults are used.\n> \n> Under these conditions, this change does not make a difference in how\n> Git GUI appears. I assume this is the expected outcome, so I take it \n> as\n> a good sign.\n> \n\nYou can test it, by changing DPI in `~/.Xresources`\n\n`xrdb -query` to see your current DPI, then increase it a little.\n\n```\nXft.dpi: 154\n```\n\n`xrdb -merge ~/.Xresources` to apply new scaling.\n\n\n> The patch is available as\n> \n> https://github.com/j6t/git-gui.git st/font-scaling-fix\n> \n> for others to test. I'd appreciate your feedback.\n> \n> \n> -- Hannes\n> \n\n\n"},{"id":"497414","messageId":"abee589d-5bad-4376-ba91-3bd611936983@kdbg.org","threadId":"61635","inReplyTo":"Q1B6FS.FVKOG950Y3UN@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-06-20T17:24:03Z","receivedAt":"2024-06-20T17:24:18Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 16.06.24 um 14:37 schrieb Serhii Tereshchenko:\n> On Sun, Jun 16 2024 at 12:30:51 +02:00:00, Johannes Sixt <j6t@kdbg.org>\n> wrote:\n>> Am 15.06.24 um 10:53 schrieb Serhii Tereshchenko:\n>>>   font create font_ui\n>>>   if {[lsearch -exact [font names] TkDefaultFont] != -1} {\n>>>       eval [linsert [font actual TkDefaultFont] 0 font configure\n>>> font_ui]\n>>\n>> My setup does not have a 4k monitor, I run KDE and I do not know if I\n>> have changed a DPI setting. For the test, I have removed the [gui]\n>> sections from my configurations to ensure that the defaults are used.\n>>\n>> Under these conditions, this change does not make a difference in how\n>> Git GUI appears. I assume this is the expected outcome, so I take it as\n>> a good sign.\n>>\n> \n> You can test it, by changing DPI in `~/.Xresources`\n> \n> `xrdb -query` to see your current DPI, then increase it a little.\n> \n> ```\n> Xft.dpi: 154\n> ```\n> \n> `xrdb -merge ~/.Xresources` to apply new scaling.\n\nThank you for this recipe. What is the expected result on the font size\nwith small and with large DPI values, with and without this patch?\n\n- When I set Xft.dpi 100, I get tiny fonts.\n- When I set it to 200, I get huge fonts.\n\nAnd that is the case with and without this patch. I expected that the\nfont size is independent from the DPI with the patch. (I run ./git-gui\nafter `make`, but without installing.)\n\nI also see the change in font size after modifying Xft.dpi in gitk, BTW.\n\nAt a minimum, the patch does not make things worse.\n\n-- Hannes\n\n"},{"id":"497421","messageId":"N75EFS.1X38FZPYSV94@gmail.com","threadId":"61635","inReplyTo":"abee589d-5bad-4376-ba91-3bd611936983@kdbg.org","subject":"Re: [PATCH] Fix default font scaling","fromName":"Serhii Tereshchenko","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-20T18:11:47Z","receivedAt":"2024-06-20T18:11:56Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"Yeah, I'm also testing this way.\n\nNo, fonts should not be independent from DPI, but now some fonts are \nscaling just like the others.\n\nTo clearly see the result, set comfortable DPI, so fonts are reasonably \nsized (if this value is close to 96, better use something larger, like \n130 or 200 to see the effect).\n\nWhen you run \"git-gui\" from the master branch, look at the fonts for:\n\n- menubar and menu (explicitly set, scaled with DPI - our baseline)\n- buttons in the lower part (Commit, Rescan, etc), labels like \"Current \nbranch\" - (unscaled, visibly smaller than menubar)\n- you can also open \"Edit -> Options\", and everything there will be \nsmaller size as well.\n\nAfter applying patch, all fonts are scaled equally (e.q. - small DPI - \neverything small, large DPI - everything big).\n\nIf, however - you see second behavior on both cases, I'm really \ninterested to get more details:\n\n- What OS and Tcl/Tk are you using?\n\nI remember few years ago it worked fine on my ArchLinux, so if other \ndistros aren't updated something yet, it may still work.\n\nOn Arch we have Tcl/Tk 8.6.14.\n\nAnd to go even deeper, we may compare results from `wish`:\n\n > package require Tk 8.5\n8.6.14\n > font configure TkDefaultFont\n-family sans-serif -size -12 -weight normal -slant roman -underline 0 \n-overstrike 0\n > font actual TkDefaultFont\n-family {Nokia Sans S60} -size 9 -weight normal -slant roman -underline \n0 -overstrike 0\n\nOn Thu, Jun 20 2024 at 19:24:03 +02:00:00, Johannes Sixt <j6t@kdbg.org> \nwrote:\n> Am 16.06.24 um 14:37 schrieb Serhii Tereshchenko:\n>>  On Sun, Jun 16 2024 at 12:30:51 +02:00:00, Johannes Sixt \n>> <j6t@kdbg.org>\n>>  wrote:\n>>>  Am 15.06.24 um 10:53 schrieb Serhii Tereshchenko:\n>>>>    font create font_ui\n>>>>    if {[lsearch -exact [font names] TkDefaultFont] != -1} {\n>>>>        eval [linsert [font actual TkDefaultFont] 0 font configure\n>>>>  font_ui]\n>>> \n>>>  My setup does not have a 4k monitor, I run KDE and I do not know \n>>> if I\n>>>  have changed a DPI setting. For the test, I have removed the [gui]\n>>>  sections from my configurations to ensure that the defaults are \n>>> used.\n>>> \n>>>  Under these conditions, this change does not make a difference in \n>>> how\n>>>  Git GUI appears. I assume this is the expected outcome, so I take \n>>> it as\n>>>  a good sign.\n>>> \n>> \n>>  You can test it, by changing DPI in `~/.Xresources`\n>> \n>>  `xrdb -query` to see your current DPI, then increase it a little.\n>> \n>>  ```\n>>  Xft.dpi: 154\n>>  ```\n>> \n>>  `xrdb -merge ~/.Xresources` to apply new scaling.\n> \n> Thank you for this recipe. What is the expected result on the font \n> size\n> with small and with large DPI values, with and without this patch?\n> \n> - When I set Xft.dpi 100, I get tiny fonts.\n> - When I set it to 200, I get huge fonts.\n> \n> And that is the case with and without this patch. I expected that the\n> font size is independent from the DPI with the patch. (I run ./git-gui\n> after `make`, but without installing.)\n> \n> I also see the change in font size after modifying Xft.dpi in gitk, \n> BTW.\n> \n> At a minimum, the patch does not make things worse.\n> \n> -- Hannes\n> \n\n\n"},{"id":"497434","messageId":"0c845460-c211-48e6-af93-a0b483817420@kdbg.org","threadId":"61635","inReplyTo":"N75EFS.1X38FZPYSV94@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-06-20T22:04:50Z","receivedAt":"2024-06-20T22:05:00Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 20.06.24 um 20:11 schrieb Serhii Tereshchenko:\n> Yeah, I'm also testing this way.\n> \n> No, fonts should not be independent from DPI, but now some fonts are\n> scaling just like the others.\n> \n> To clearly see the result, set comfortable DPI, so fonts are reasonably\n> sized (if this value is close to 96, better use something larger, like\n> 130 or 200 to see the effect).\n> \n> When you run \"git-gui\" from the master branch, look at the fonts for:\n> \n> - menubar and menu (explicitly set, scaled with DPI - our baseline)\n> - buttons in the lower part (Commit, Rescan, etc), labels like \"Current\n> branch\" - (unscaled, visibly smaller than menubar)\n> - you can also open \"Edit -> Options\", and everything there will be\n> smaller size as well.\n> \n> After applying patch, all fonts are scaled equally (e.q. - small DPI -\n> everything small, large DPI - everything big).\n> \n> If, however - you see second behavior on both cases, I'm really\n> interested to get more details:\n\nI see the second behavior regardless of the patch, i.e. with small DPI\nall fonts are small, with large DPI all fonts are large.\n\nThe label \"Current branch\" is the same size as other fonts except when I\nselect a different font size in Edit->Options as \"Main Font\".\n\n\n> - What OS and Tcl/Tk are you using?\n> \n> I remember few years ago it worked fine on my ArchLinux, so if other\n> distros aren't updated something yet, it may still work.\n> \n> On Arch we have Tcl/Tk 8.6.14.\n> \n> And to go even deeper, we may compare results from `wish`:\n> \n>> package require Tk 8.5\n> 8.6.14\n>> font configure TkDefaultFont\n> -family sans-serif -size -12 -weight normal -slant roman -underline 0\n> -overstrike 0\n>> font actual TkDefaultFont\n> -family {Nokia Sans S60} -size 9 -weight normal -slant roman -underline\n> 0 -overstrike 0\n\nI have this:\n\n% package require Tk 8.5\n8.6.12\n% font configure TkDefaultFont\n-family sans-serif -size -12 -weight normal -slant roman -underline 0\n-overstrike 0\n%\n% font actual TkDefaultFont\n-family Arial -size 9 -weight normal -slant roman -underline 0 -overstrike 0\n%\n\nI am using openSUSE Leap 15.5 under KDE Frameworks 5.103.0\n\n-- Hannes\n\n"},{"id":"497470","messageId":"3M5FFS.HXL15VW2HPOG1@gmail.com","threadId":"61635","inReplyTo":"0c845460-c211-48e6-af93-a0b483817420@kdbg.org","subject":"Re: [PATCH] Fix default font scaling","fromName":"Serhii Tereshchenko","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-21T07:18:03Z","receivedAt":"2024-06-21T07:18:13Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"\n\nOn Fri, Jun 21 2024 at 00:04:50 +02:00:00, Johannes Sixt <j6t@kdbg.org> \nwrote:\n> Am 20.06.24 um 20:11 schrieb Serhii Tereshchenko:\n>>  Yeah, I'm also testing this way.\n>> \n>>  No, fonts should not be independent from DPI, but now some fonts are\n>>  scaling just like the others.\n>> \n>>  To clearly see the result, set comfortable DPI, so fonts are \n>> reasonably\n>>  sized (if this value is close to 96, better use something larger, \n>> like\n>>  130 or 200 to see the effect).\n>> \n>>  When you run \"git-gui\" from the master branch, look at the fonts \n>> for:\n>> \n>>  - menubar and menu (explicitly set, scaled with DPI - our baseline)\n>>  - buttons in the lower part (Commit, Rescan, etc), labels like \n>> \"Current\n>>  branch\" - (unscaled, visibly smaller than menubar)\n>>  - you can also open \"Edit -> Options\", and everything there will be\n>>  smaller size as well.\n>> \n>>  After applying patch, all fonts are scaled equally (e.q. - small \n>> DPI -\n>>  everything small, large DPI - everything big).\n>> \n>>  If, however - you see second behavior on both cases, I'm really\n>>  interested to get more details:\n> \n> I see the second behavior regardless of the patch, i.e. with small DPI\n> all fonts are small, with large DPI all fonts are large.\n> \n> The label \"Current branch\" is the same size as other fonts except \n> when I\n> select a different font size in Edit->Options as \"Main Font\".\n> \n> \n>>  - What OS and Tcl/Tk are you using?\n>> \n>>  I remember few years ago it worked fine on my ArchLinux, so if other\n>>  distros aren't updated something yet, it may still work.\n>> \n>>  On Arch we have Tcl/Tk 8.6.14.\n>> \n>>  And to go even deeper, we may compare results from `wish`:\n>> \n>>>  package require Tk 8.5\n>>  8.6.14\n>>>  font configure TkDefaultFont\n>>  -family sans-serif -size -12 -weight normal -slant roman -underline \n>> 0\n>>  -overstrike 0\n>>>  font actual TkDefaultFont\n>>  -family {Nokia Sans S60} -size 9 -weight normal -slant roman \n>> -underline\n>>  0 -overstrike 0\n> \n> I have this:\n> \n> % package require Tk 8.5\n> 8.6.12\n> % font configure TkDefaultFont\n> -family sans-serif -size -12 -weight normal -slant roman -underline 0\n> -overstrike 0\n> %\n> % font actual TkDefaultFont\n> -family Arial -size 9 -weight normal -slant roman -underline 0 \n> -overstrike 0\n> %\n> \n> I am using openSUSE Leap 15.5 under KDE Frameworks 5.103.0\n> \n> -- Hannes\n> \n\nThanks! I tried booting into Fedora/37 with the same Tk version, and it \nindeed does not have this scaling problem.\n\nThen, I downgraded packages on Arch to 8.6.12 and 8.6.13 - also no \nproblem.\n\nThe only version affected is 8.6.14.\n\nThat's probably a bug in Tk (and there's quite a few reported, mostly \nabout \"tk scaling\" https://core.tcl-lang.org/tk/info/1de3a48312, we \ndon't use it explicitly in git-gui but on my system it is set to 1.3)\n\n\n"},{"id":"497543","messageId":"506e1f16-ac02-496c-a9dc-414726c1c37f@kdbg.org","threadId":"61635","inReplyTo":"3M5FFS.HXL15VW2HPOG1@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-06-23T09:13:53Z","receivedAt":"2024-06-23T09:14:01Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 21.06.24 um 09:18 schrieb Serhii Tereshchenko:\n> Thanks! I tried booting into Fedora/37 with the same Tk version, and it\n> indeed does not have this scaling problem.\n> \n> Then, I downgraded packages on Arch to 8.6.12 and 8.6.13 - also no problem.\n> \n> The only version affected is 8.6.14.\n> \n> That's probably a bug in Tk (and there's quite a few reported, mostly\n> about \"tk scaling\" https://core.tcl-lang.org/tk/info/1de3a48312, we\n> don't use it explicitly in git-gui but on my system it is set to 1.3)\n\nWhat is the best course of action now? Since this change does not make\nthings any different for me on Linux+KDE, I am inclined to pick up this\npatch with a modified commit message and code comment that clearly state\nthat this is a work-around for a bug in Tk introduced in 8.6.14. This\nwould help users who upgrade from an earlier version of Tk, because it\ndoes not look like a fix of Tk is in the works (or that the issue is\nregarded as a regression by Tk people at all).\n\nSuggestions?\n\n-- Hannes\n\n"},{"id":"497546","messageId":"YY2JFS.UYR26AJBROJJ3@gmail.com","threadId":"61635","inReplyTo":"506e1f16-ac02-496c-a9dc-414726c1c37f@kdbg.org","subject":"Re: [PATCH] Fix default font scaling","fromName":"","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-23T10:11:22Z","receivedAt":"2024-06-23T10:11:32Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"\n\nOn нд, чер 23 2024 at 11:13:53 +02:00:00, Johannes Sixt \n<j6t@kdbg.org> wrote:\n> Am 21.06.24 um 09:18 schrieb Serhii Tereshchenko:\n>>  Thanks! I tried booting into Fedora/37 with the same Tk version, \n>> and it\n>>  indeed does not have this scaling problem.\n>> \n>>  Then, I downgraded packages on Arch to 8.6.12 and 8.6.13 - also no \n>> problem.\n>> \n>>  The only version affected is 8.6.14.\n>> \n>>  That's probably a bug in Tk (and there's quite a few reported, \n>> mostly\n>>  about \"tk scaling\" https://core.tcl-lang.org/tk/info/1de3a48312, we\n>>  don't use it explicitly in git-gui but on my system it is set to \n>> 1.3)\n> \n> What is the best course of action now? Since this change does not make\n> things any different for me on Linux+KDE, I am inclined to pick up \n> this\n> patch with a modified commit message and code comment that clearly \n> state\n> that this is a work-around for a bug in Tk introduced in 8.6.14. This\n> would help users who upgrade from an earlier version of Tk, because it\n> does not look like a fix of Tk is in the works (or that the issue is\n> regarded as a regression by Tk people at all).\n> \n> Suggestions?\n> \n> -- Hannes\n\nI tried running default git-gui and this patch on macOS 12 Monterey, \nand that version does not have font scaling, so there's no problem. I \nwill ask around and maybe find someone with latest macOS, which has \nfont scaling, and see if there's a problem.\n\nPatch does not breaks anything, but produces a warning due to system \nfonts being present in 'font names'.\n\nThen, if turns out this linux-specific problem - i'd limit this fix \nonly to linux. If this affects other platforms - i'd filter fonts to \nonly include those starting with 'Tk' prefix.\n\n\n\n"},{"id":"497547","messageId":"3LDJFS.N7X2NCO8QRE9@gmail.com","threadId":"61635","inReplyTo":"YY2JFS.UYR26AJBROJJ3@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"","fromEmail":"serg.partizan@gmail.com","sentAt":"2024-06-23T14:00:39Z","receivedAt":"2024-06-23T14:00:51Z","isPatch":true,"sender":{"key":"serg.partizan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/301015?v=4"},"body":"\n\nOn нд, чер 23 2024 at 13:11:22 +03:00:00, serg.partizan@gmail.com \nwrote:\n> \n> \n> On нд, чер 23 2024 at 11:13:53 +02:00:00, Johannes Sixt \n> <j6t@kdbg.org> wrote:\n>> Am 21.06.24 um 09:18 schrieb Serhii Tereshchenko:\n>>>  Thanks! I tried booting into Fedora/37 with the same Tk version, \n>>> and it\n>>>  indeed does not have this scaling problem.\n>>> \n>>>  Then, I downgraded packages on Arch to 8.6.12 and 8.6.13 - also no \n>>> problem.\n>>> \n>>>  The only version affected is 8.6.14.\n>>> \n>>>  That's probably a bug in Tk (and there's quite a few reported, \n>>> mostly\n>>>  about \"tk scaling\" https://core.tcl-lang.org/tk/info/1de3a48312, we\n>>>  don't use it explicitly in git-gui but on my system it is set to \n>>> 1.3)\n>> \n>> What is the best course of action now? Since this change does not \n>> make\n>> things any different for me on Linux+KDE, I am inclined to pick up \n>> this\n>> patch with a modified commit message and code comment that clearly \n>> state\n>> that this is a work-around for a bug in Tk introduced in 8.6.14. This\n>> would help users who upgrade from an earlier version of Tk, because \n>> it\n>> does not look like a fix of Tk is in the works (or that the issue is\n>> regarded as a regression by Tk people at all).\n>> \n>> Suggestions?\n>> \n>> -- Hannes\n> \n> I tried running default git-gui and this patch on macOS 12 Monterey, \n> and that version does not have font scaling, so there's no problem. I \n> will ask around and maybe find someone with latest macOS, which has \n> font scaling, and see if there's a problem.\n> \n> Patch does not breaks anything, but produces a warning due to system \n> fonts being present in 'font names'.\n> \n> Then, if turns out this linux-specific problem - i'd limit this fix \n> only to linux. If this affects other platforms - i'd filter fonts to \n> only include those starting with 'Tk' prefix.\n\nAfter more reasearch, I found this:\n\nhttps://core.tcl-lang.org/tk/info/dccd82bdc7\n\nThis is x11-only bug, which existed for a long time and i'm suprized \nwe're seeing it only in 8.6.14, because .13 and .12 are using the same \nnegative sizes.\n\nIt is also fixed for a long time in the 8.7 branch and not backported \ninto 8.6.\n\nhttps://github.com/tcltk/tk/blob/7c3e2ff815e23cc6ac1ce9891ca659e709776ea4/library/ttk/fonts.tcl\n\nAlso, you may be not seeing this, because your distro may have applied \nthis patch: \nhttps://sources.debian.org/patches/tk8.6/8.6.9-2/font-sizes.diff/\n\nWith this information, i'm more inclined to making a patch for \nArchLinux package. So, it will fix every tk app, and not only git-gui.\n\nWhat do you think?\n\n\n"},{"id":"497548","messageId":"ade809ad-3748-4124-97c2-9d6c606c0585@kdbg.org","threadId":"61635","inReplyTo":"3LDJFS.N7X2NCO8QRE9@gmail.com","subject":"Re: [PATCH] Fix default font scaling","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-06-23T15:50:44Z","receivedAt":"2024-06-23T15:50:52Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 23.06.24 um 16:00 schrieb serg.partizan@gmail.com:\n> This is x11-only bug, which existed for a long time and i'm suprized\n> we're seeing it only in 8.6.14, because .13 and .12 are using the same\n> negative sizes.\n> \n> It is also fixed for a long time in the 8.7 branch and not backported\n> into 8.6.\n> \n> https://github.com/tcltk/tk/blob/7c3e2ff815e23cc6ac1ce9891ca659e709776ea4/library/ttk/fonts.tcl\n> \n> Also, you may be not seeing this, because your distro may have applied\n> this patch:\n> https://sources.debian.org/patches/tk8.6/8.6.9-2/font-sizes.diff/\n> \n> With this information, i'm more inclined to making a patch for ArchLinux\n> package. So, it will fix every tk app, and not only git-gui.\n> \n> What do you think?\n\nI think that would make sense. It would relieve me from taking\nresponsibility for a patch whose effects I do not understand well.\n\nThanks,\n-- Hannes\n\n"}]}