diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2009-11-23 08:55:08 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2009-11-23 08:55:08 +0000 |
commit | 581e51e8918b3ba9b58e67768a1de39ce5f1cbd3 (patch) | |
tree | b210e82974c9e4ab1d3cc1c0a9e86348a425526b /src/xsettings.c | |
parent | 0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75 (diff) | |
download | emacs-581e51e8918b3ba9b58e67768a1de39ce5f1cbd3.tar.gz |
Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
* xfns.c (Fx_select_font): Try to convert Fontconfig name to Gtk name
because that is what Gtk+ font dialog understands.
* font.c (font_make_object, Fcopy_font_spec): Use Fcopy_alist instead
of Fcopy_sequence.
(font_open_by_name): Put name given into QCname for font-object returned.
* frame.c (x_set_font): Save original font name as frame parameter
font-parameter.
* xsettings.c (set_default_xft_settings): New function.
(init_xfd_settings): Call set_default_xft_settings if no XSETTINGS window
is found.
Diffstat (limited to 'src/xsettings.c')
-rw-r--r-- | src/xsettings.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/xsettings.c b/src/xsettings.c index 0dabc060b9a..68c1e0c4eeb 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -368,6 +368,25 @@ read_xft_settings (dpyinfo, settings) } static void +set_default_xft_settings (dpyinfo) + struct x_display_info *dpyinfo; +{ + FcPattern *pat; + pat = FcPatternCreate (); + XftDefaultSubstitute (dpyinfo->display, + XScreenNumberOfScreen (dpyinfo->screen), + pat); + + FcPatternDel (pat, FC_ANTIALIAS); + FcPatternAddBool (pat, FC_ANTIALIAS, FcTrue); + FcPatternDel (pat, FC_HINTING); + FcPatternAddBool (pat, FC_HINTING, FcTrue); + FcPatternDel (pat, FC_HINT_STYLE); + FcPatternAddInteger (pat, FC_HINT_STYLE,FC_HINT_MEDIUM); + XftDefaultSet (dpyinfo->display, pat); +} + +static void apply_xft_settings (dpyinfo, send_event_p) struct x_display_info *dpyinfo; int send_event_p; @@ -546,6 +565,8 @@ init_xfd_settings (dpyinfo) get_prop_window (dpyinfo); if (dpyinfo->xsettings_window != None) apply_xft_settings (dpyinfo, False); + else + set_default_xft_settings (dpyinfo); UNBLOCK_INPUT; |