* [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
@ 2012-03-08 12:30 Jonathan Nieder
2012-03-08 12:46 ` Josh Triplett
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jonathan Nieder @ 2012-03-08 12:30 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras, Pat Thoyts, Josh Triplett, Mark Hills
The following only concerns systems using X and the client-side font
rendering framework from freedesktop.org. Windows and Mac OS X are
not affected.
Starting with version 8.5, Tk uses freetype and fontconfig by default
to render fonts on platforms that support it. Gitk currently defaults
to the font Helvetica for the interface and Courier for diffs, and
both unfortunately look rather bad on screen in the default
configuration on many Linux distros with anti-aliasing and poor
hinting.
It is better to default to "sans" and "monospace", which are mapped by
fontconfig to some appropriate font of the sysadmin and user's
choosing (typically Bitstream Vera Sans and Mono). The result looks
more sensible and it makes gitk feel like a well-behaved software
citizen since its fonts match other native apps.
This patch does not change the appearance of gitk for users that have
already run it, since gitk uses the remembered UI and diff font names
from ~/.gitk
Requested-by: Michael Biebl <biebl@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Hi,
A variant of this patch that just unconditionally set the fonts has
been in Debian for more than a year, but just now I finally got around
to making it conditional. Tested with tk 8.5 (where fontconfig is
used) and tk 8.4 (where it isn't) and the autodetection seems to work.
Sensible?
Jonathan
gitk-git/gitk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 64ef3c40..6981cb20 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq "aqua"} {
set mainfont {{Lucida Grande} 9}
set textfont {Monaco 9}
set uifont {{Lucida Grande} 9 bold}
+} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq "xft"} {
+ # fontconfig!
+ set mainfont {sans 9}
+ set textfont {monospace 9}
+ set uifont {sans 9 bold}
} else {
set mainfont {Helvetica 9}
set textfont {Courier 9}
--
1.7.9.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
2012-03-08 12:30 [PATCH] gitk: use symbolic font names "sans" and "monospace" when available Jonathan Nieder
@ 2012-03-08 12:46 ` Josh Triplett
2012-03-08 13:26 ` Jonathan Nieder
2012-03-08 21:19 ` Mark Hills
2012-03-18 23:25 ` Paul Mackerras
2 siblings, 1 reply; 6+ messages in thread
From: Josh Triplett @ 2012-03-08 12:46 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Paul Mackerras, Pat Thoyts, Mark Hills
On Thu, Mar 08, 2012 at 06:30:11AM -0600, Jonathan Nieder wrote:
> The following only concerns systems using X and the client-side font
> rendering framework from freedesktop.org. Windows and Mac OS X are
> not affected.
>
> Starting with version 8.5, Tk uses freetype and fontconfig by default
> to render fonts on platforms that support it. Gitk currently defaults
> to the font Helvetica for the interface and Courier for diffs, and
> both unfortunately look rather bad on screen in the default
> configuration on many Linux distros with anti-aliasing and poor
> hinting.
>
> It is better to default to "sans" and "monospace", which are mapped by
> fontconfig to some appropriate font of the sysadmin and user's
> choosing (typically Bitstream Vera Sans and Mono). The result looks
> more sensible and it makes gitk feel like a well-behaved software
> citizen since its fonts match other native apps.
>
> This patch does not change the appearance of gitk for users that have
> already run it, since gitk uses the remembered UI and diff font names
> from ~/.gitk
>
> Requested-by: Michael Biebl <biebl@debian.org>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> Hi,
>
> A variant of this patch that just unconditionally set the fonts has
> been in Debian for more than a year, but just now I finally got around
> to making it conditional. Tested with tk 8.5 (where fontconfig is
> used) and tk 8.4 (where it isn't) and the autodetection seems to work.
>
> Sensible?
>
> Jonathan
>
> gitk-git/gitk | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index 64ef3c40..6981cb20 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq "aqua"} {
> set mainfont {{Lucida Grande} 9}
> set textfont {Monaco 9}
> set uifont {{Lucida Grande} 9 bold}
> +} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq "xft"} {
> + # fontconfig!
> + set mainfont {sans 9}
> + set textfont {monospace 9}
> + set uifont {sans 9 bold}
> } else {
> set mainfont {Helvetica 9}
> set textfont {Courier 9}
> --
> 1.7.9.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
2012-03-08 12:46 ` Josh Triplett
@ 2012-03-08 13:26 ` Jonathan Nieder
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Nieder @ 2012-03-08 13:26 UTC (permalink / raw)
To: Josh Triplett; +Cc: git, Paul Mackerras, Pat Thoyts, Mark Hills
Josh Triplett wrote:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Thanks for looking it over.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
2012-03-08 12:30 [PATCH] gitk: use symbolic font names "sans" and "monospace" when available Jonathan Nieder
2012-03-08 12:46 ` Josh Triplett
@ 2012-03-08 21:19 ` Mark Hills
2012-03-18 23:25 ` Paul Mackerras
2 siblings, 0 replies; 6+ messages in thread
From: Mark Hills @ 2012-03-08 21:19 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Paul Mackerras, Pat Thoyts, Josh Triplett
On Thu, 8 Mar 2012, Jonathan Nieder wrote:
> The following only concerns systems using X and the client-side font
> rendering framework from freedesktop.org. Windows and Mac OS X are
> not affected.
>
> Starting with version 8.5, Tk uses freetype and fontconfig by default
> to render fonts on platforms that support it. Gitk currently defaults
> to the font Helvetica for the interface and Courier for diffs, and
> both unfortunately look rather bad on screen in the default
> configuration on many Linux distros with anti-aliasing and poor
> hinting.
>
> It is better to default to "sans" and "monospace", which are mapped by
> fontconfig to some appropriate font of the sysadmin and user's
> choosing (typically Bitstream Vera Sans and Mono). The result looks
> more sensible and it makes gitk feel like a well-behaved software
> citizen since its fonts match other native apps.
>
> This patch does not change the appearance of gitk for users that have
> already run it, since gitk uses the remembered UI and diff font names
> from ~/.gitk
>
> Requested-by: Michael Biebl <biebl@debian.org>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Sounds reasonable to me.
Acked-by: Mark Hills <mark@pogo.org.uk>
> ---
> Hi,
>
> A variant of this patch that just unconditionally set the fonts has
> been in Debian for more than a year, but just now I finally got around
> to making it conditional. Tested with tk 8.5 (where fontconfig is
> used) and tk 8.4 (where it isn't) and the autodetection seems to work.
>
> Sensible?
>
> Jonathan
>
> gitk-git/gitk | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index 64ef3c40..6981cb20 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq "aqua"} {
> set mainfont {{Lucida Grande} 9}
> set textfont {Monaco 9}
> set uifont {{Lucida Grande} 9 bold}
> +} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq "xft"} {
> + # fontconfig!
> + set mainfont {sans 9}
> + set textfont {monospace 9}
> + set uifont {sans 9 bold}
> } else {
> set mainfont {Helvetica 9}
> set textfont {Courier 9}
>
--
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
2012-03-08 12:30 [PATCH] gitk: use symbolic font names "sans" and "monospace" when available Jonathan Nieder
2012-03-08 12:46 ` Josh Triplett
2012-03-08 21:19 ` Mark Hills
@ 2012-03-18 23:25 ` Paul Mackerras
2012-03-19 4:53 ` Jonathan Nieder
2 siblings, 1 reply; 6+ messages in thread
From: Paul Mackerras @ 2012-03-18 23:25 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Pat Thoyts, Josh Triplett, Mark Hills
On Thu, Mar 08, 2012 at 06:30:11AM -0600, Jonathan Nieder wrote:
> The following only concerns systems using X and the client-side font
> rendering framework from freedesktop.org. Windows and Mac OS X are
> not affected.
>
> Starting with version 8.5, Tk uses freetype and fontconfig by default
> to render fonts on platforms that support it. Gitk currently defaults
> to the font Helvetica for the interface and Courier for diffs, and
> both unfortunately look rather bad on screen in the default
> configuration on many Linux distros with anti-aliasing and poor
> hinting.
>
> It is better to default to "sans" and "monospace", which are mapped by
> fontconfig to some appropriate font of the sysadmin and user's
> choosing (typically Bitstream Vera Sans and Mono). The result looks
> more sensible and it makes gitk feel like a well-behaved software
> citizen since its fonts match other native apps.
>
> This patch does not change the appearance of gitk for users that have
> already run it, since gitk uses the remembered UI and diff font names
> from ~/.gitk
>
> Requested-by: Michael Biebl <biebl@debian.org>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks, applied.
Paul.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk: use symbolic font names "sans" and "monospace" when available
2012-03-18 23:25 ` Paul Mackerras
@ 2012-03-19 4:53 ` Jonathan Nieder
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Nieder @ 2012-03-19 4:53 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git, Pat Thoyts, Josh Triplett, Mark Hills
Paul Mackerras wrote:
> Thanks, applied.
Thanks to all of you for looking it over.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-19 4:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08 12:30 [PATCH] gitk: use symbolic font names "sans" and "monospace" when available Jonathan Nieder
2012-03-08 12:46 ` Josh Triplett
2012-03-08 13:26 ` Jonathan Nieder
2012-03-08 21:19 ` Mark Hills
2012-03-18 23:25 ` Paul Mackerras
2012-03-19 4:53 ` Jonathan Nieder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).