Skip to content

Commit 5c9096f

Browse files
jrnpaulusmack
authored andcommitted
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 <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Acked-by: Mark Hills <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 585c27c commit 5c9096f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gitk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11521,6 +11521,11 @@ if {[tk windowingsystem] eq "aqua"} {
1152111521
set mainfont {{Lucida Grande} 9}
1152211522
set textfont {Monaco 9}
1152311523
set uifont {{Lucida Grande} 9 bold}
11524+
} elseif {![catch {::tk::pkgconfig get fontsystem} xft] && $xft eq "xft"} {
11525+
# fontconfig!
11526+
set mainfont {sans 9}
11527+
set textfont {monospace 9}
11528+
set uifont {sans 9 bold}
1152411529
} else {
1152511530
set mainfont {Helvetica 9}
1152611531
set textfont {Courier 9}

0 commit comments

Comments
 (0)