summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2012-03-08 12:30:11 (GMT)
committerPaul Mackerras <paulus@samba.org>2012-03-18 23:23:43 (GMT)
commit5c9096f74756bdac219b9819060b581fc807e194 (patch)
treea8cb889827ffa827f04258eada3265ff68bdef15 /gitk
parent585c27cb22676a55dea2681dfb768e0970cd6639 (diff)
downloadgit-5c9096f74756bdac219b9819060b581fc807e194.zip
git-5c9096f74756bdac219b9819060b581fc807e194.tar.gz
git-5c9096f74756bdac219b9819060b581fc807e194.tar.bz2
gitk: Use symbolic font names "sans" and "monospace" when available
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> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Acked-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk5
1 files changed, 5 insertions, 0 deletions
diff --git a/gitk b/gitk
index 5e3ad15..36a48d5 100755
--- a/gitk
+++ b/gitk
@@ -11521,6 +11521,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}