{"thread":{"id":"29885","subject":"[PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","startedAt":"2012-03-08T12:30:11Z","lastAt":"2012-03-19T04:53:18Z","messageCount":6,"participants":["Jonathan Nieder","Josh Triplett","Mark Hills","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"186432","messageId":"20120308123011.GA4355@burratino","threadId":"29885","inReplyTo":null,"subject":"[PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-08T12:30:11Z","receivedAt":"2012-03-08T12:30:11Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"The following only concerns systems using X and the client-side font\nrendering framework from freedesktop.org.  Windows and Mac OS X are\nnot affected.\n\nStarting with version 8.5, Tk uses freetype and fontconfig by default\nto render fonts on platforms that support it.  Gitk currently defaults\nto the font Helvetica for the interface and Courier for diffs, and\nboth unfortunately look rather bad on screen in the default\nconfiguration on many Linux distros with anti-aliasing and poor\nhinting.\n\nIt is better to default to \"sans\" and \"monospace\", which are mapped by\nfontconfig to some appropriate font of the sysadmin and user's\nchoosing (typically Bitstream Vera Sans and Mono).  The result looks\nmore sensible and it makes gitk feel like a well-behaved software\ncitizen since its fonts match other native apps.\n\nThis patch does not change the appearance of gitk for users that have\nalready run it, since gitk uses the remembered UI and diff font names\nfrom ~/.gitk\n\nRequested-by: Michael Biebl <biebl@debian.org>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nHi,\n\nA variant of this patch that just unconditionally set the fonts has\nbeen in Debian for more than a year, but just now I finally got around\nto making it conditional.  Tested with tk 8.5 (where fontconfig is\nused) and tk 8.4 (where it isn't) and the autodetection seems to work.\n\nSensible?\n\nJonathan\n\n gitk-git/gitk |    5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 64ef3c40..6981cb20 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq \"aqua\"} {\n     set mainfont {{Lucida Grande} 9}\n     set textfont {Monaco 9}\n     set uifont {{Lucida Grande} 9 bold}\n+} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq \"xft\"} {\n+    # fontconfig!\n+    set mainfont {sans 9}\n+    set textfont {monospace 9}\n+    set uifont {sans 9 bold}\n } else {\n     set mainfont {Helvetica 9}\n     set textfont {Courier 9}\n-- \n1.7.9.2\n"},{"id":"186434","messageId":"20120308124635.GA24679@leaf","threadId":"29885","inReplyTo":"20120308123011.GA4355@burratino","subject":"Re: [PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Josh Triplett","fromEmail":"josh@joshtriplett.org","sentAt":"2012-03-08T12:46:35Z","receivedAt":"2012-03-08T12:46:35Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"On Thu, Mar 08, 2012 at 06:30:11AM -0600, Jonathan Nieder wrote:\n> The following only concerns systems using X and the client-side font\n> rendering framework from freedesktop.org.  Windows and Mac OS X are\n> not affected.\n> \n> Starting with version 8.5, Tk uses freetype and fontconfig by default\n> to render fonts on platforms that support it.  Gitk currently defaults\n> to the font Helvetica for the interface and Courier for diffs, and\n> both unfortunately look rather bad on screen in the default\n> configuration on many Linux distros with anti-aliasing and poor\n> hinting.\n> \n> It is better to default to \"sans\" and \"monospace\", which are mapped by\n> fontconfig to some appropriate font of the sysadmin and user's\n> choosing (typically Bitstream Vera Sans and Mono).  The result looks\n> more sensible and it makes gitk feel like a well-behaved software\n> citizen since its fonts match other native apps.\n> \n> This patch does not change the appearance of gitk for users that have\n> already run it, since gitk uses the remembered UI and diff font names\n> from ~/.gitk\n> \n> Requested-by: Michael Biebl <biebl@debian.org>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nReviewed-by: Josh Triplett <josh@joshtriplett.org>\n\n> ---\n> Hi,\n> \n> A variant of this patch that just unconditionally set the fonts has\n> been in Debian for more than a year, but just now I finally got around\n> to making it conditional.  Tested with tk 8.5 (where fontconfig is\n> used) and tk 8.4 (where it isn't) and the autodetection seems to work.\n> \n> Sensible?\n> \n> Jonathan\n> \n>  gitk-git/gitk |    5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 64ef3c40..6981cb20 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq \"aqua\"} {\n>      set mainfont {{Lucida Grande} 9}\n>      set textfont {Monaco 9}\n>      set uifont {{Lucida Grande} 9 bold}\n> +} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq \"xft\"} {\n> +    # fontconfig!\n> +    set mainfont {sans 9}\n> +    set textfont {monospace 9}\n> +    set uifont {sans 9 bold}\n>  } else {\n>      set mainfont {Helvetica 9}\n>      set textfont {Courier 9}\n> -- \n> 1.7.9.2\n> \n"},{"id":"186447","messageId":"20120308132607.GE2181@burratino","threadId":"29885","inReplyTo":"20120308124635.GA24679@leaf","subject":"Re: [PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-08T13:26:07Z","receivedAt":"2012-03-08T13:26:07Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Josh Triplett wrote:\n\n> Reviewed-by: Josh Triplett <josh@joshtriplett.org>\n\nThanks for looking it over.\n"},{"id":"186501","messageId":"alpine.LNX.2.01.1203082118260.1467@stax.localdomain","threadId":"29885","inReplyTo":"20120308123011.GA4355@burratino","subject":"Re: [PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Mark Hills","fromEmail":"mark@pogo.org.uk","sentAt":"2012-03-08T21:19:30Z","receivedAt":"2012-03-08T21:19:30Z","isPatch":true,"sender":{"key":"mark@pogo.org.uk","avatar":null},"body":"On Thu, 8 Mar 2012, Jonathan Nieder wrote:\n\n> The following only concerns systems using X and the client-side font\n> rendering framework from freedesktop.org.  Windows and Mac OS X are\n> not affected.\n> \n> Starting with version 8.5, Tk uses freetype and fontconfig by default\n> to render fonts on platforms that support it.  Gitk currently defaults\n> to the font Helvetica for the interface and Courier for diffs, and\n> both unfortunately look rather bad on screen in the default\n> configuration on many Linux distros with anti-aliasing and poor\n> hinting.\n> \n> It is better to default to \"sans\" and \"monospace\", which are mapped by\n> fontconfig to some appropriate font of the sysadmin and user's\n> choosing (typically Bitstream Vera Sans and Mono).  The result looks\n> more sensible and it makes gitk feel like a well-behaved software\n> citizen since its fonts match other native apps.\n> \n> This patch does not change the appearance of gitk for users that have\n> already run it, since gitk uses the remembered UI and diff font names\n> from ~/.gitk\n> \n> Requested-by: Michael Biebl <biebl@debian.org>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nSounds reasonable to me.\n\nAcked-by: Mark Hills <mark@pogo.org.uk>\n\n> ---\n> Hi,\n> \n> A variant of this patch that just unconditionally set the fonts has\n> been in Debian for more than a year, but just now I finally got around\n> to making it conditional.  Tested with tk 8.5 (where fontconfig is\n> used) and tk 8.4 (where it isn't) and the autodetection seems to work.\n> \n> Sensible?\n> \n> Jonathan\n> \n>  gitk-git/gitk |    5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 64ef3c40..6981cb20 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -11426,6 +11426,11 @@ if {[tk windowingsystem] eq \"aqua\"} {\n>      set mainfont {{Lucida Grande} 9}\n>      set textfont {Monaco 9}\n>      set uifont {{Lucida Grande} 9 bold}\n> +} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq \"xft\"} {\n> +    # fontconfig!\n> +    set mainfont {sans 9}\n> +    set textfont {monospace 9}\n> +    set uifont {sans 9 bold}\n>  } else {\n>      set mainfont {Helvetica 9}\n>      set textfont {Courier 9}\n> \n\n-- \nMark\n"},{"id":"187225","messageId":"20120318232503.GG26977@bloggs.ozlabs.ibm.com","threadId":"29885","inReplyTo":"20120308123011.GA4355@burratino","subject":"Re: [PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2012-03-18T23:25:04Z","receivedAt":"2012-03-18T23:25:04Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Mar 08, 2012 at 06:30:11AM -0600, Jonathan Nieder wrote:\n> The following only concerns systems using X and the client-side font\n> rendering framework from freedesktop.org.  Windows and Mac OS X are\n> not affected.\n> \n> Starting with version 8.5, Tk uses freetype and fontconfig by default\n> to render fonts on platforms that support it.  Gitk currently defaults\n> to the font Helvetica for the interface and Courier for diffs, and\n> both unfortunately look rather bad on screen in the default\n> configuration on many Linux distros with anti-aliasing and poor\n> hinting.\n> \n> It is better to default to \"sans\" and \"monospace\", which are mapped by\n> fontconfig to some appropriate font of the sysadmin and user's\n> choosing (typically Bitstream Vera Sans and Mono).  The result looks\n> more sensible and it makes gitk feel like a well-behaved software\n> citizen since its fonts match other native apps.\n> \n> This patch does not change the appearance of gitk for users that have\n> already run it, since gitk uses the remembered UI and diff font names\n> from ~/.gitk\n> \n> Requested-by: Michael Biebl <biebl@debian.org>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks, applied.\n\nPaul.\n"},{"id":"187238","messageId":"20120319045318.GB25237@burratino","threadId":"29885","inReplyTo":"20120318232503.GG26977@bloggs.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: use symbolic font names \"sans\" and \"monospace\" when available","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-03-19T04:53:18Z","receivedAt":"2012-03-19T04:53:18Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Paul Mackerras wrote:\n\n> Thanks, applied.\n\nThanks to all of you for looking it over.\n"}]}