diff options
| author | Jan Djärv | 2010-06-22 09:55:08 +0200 |
|---|---|---|
| committer | Jan Djärv | 2010-06-22 09:55:08 +0200 |
| commit | e9b7ab963b49d6eaaa2359ac903a1fe80943ec95 (patch) | |
| tree | 472426edab0233bd2ca3e272061ffdc1f2f4e77c /src | |
| parent | c50b0f11a5a62629abfd3f97619c13f3ab99364c (diff) | |
| download | emacs-e9b7ab963b49d6eaaa2359ac903a1fe80943ec95.tar.gz emacs-e9b7ab963b49d6eaaa2359ac903a1fe80943ec95.zip | |
Don't use font names from GConf if font backend can't handle it (bug#6478).
* xfns.c (x_default_font_parameter): Try to open font from system
before using it (bug#6478). Rename got_from_gconf to got_from_system.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xfns.c | 26 |
2 files changed, 21 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 121d06577b0..3d8e962e070 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-06-22 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xfns.c (x_default_font_parameter): Try to open font from system | ||
| 4 | before using it (bug#6478). Rename got_from_gconf to got_from_system. | ||
| 5 | |||
| 1 | 2010-06-22 Keith Packard <keithp@keithp.com> (tiny change) | 6 | 2010-06-22 Keith Packard <keithp@keithp.com> (tiny change) |
| 2 | 7 | ||
| 3 | * font.c (font_parse_fcname): Allow . for sizes like 7.5 (bug#6437). | 8 | * font.c (font_parse_fcname): Allow . for sizes like 7.5 (bug#6437). |
diff --git a/src/xfns.c b/src/xfns.c index d19914e8dec..4f9afeef6cc 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3064,8 +3064,8 @@ x_default_font_parameter (f, parms) | |||
| 3064 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 3064 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 3065 | Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, | 3065 | Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, |
| 3066 | RES_TYPE_STRING); | 3066 | RES_TYPE_STRING); |
| 3067 | Lisp_Object font; | 3067 | Lisp_Object font = Qnil; |
| 3068 | int got_from_gconf = 0; | 3068 | int got_from_system = 0; |
| 3069 | if (EQ (font_param, Qunbound)) | 3069 | if (EQ (font_param, Qunbound)) |
| 3070 | font_param = Qnil; | 3070 | font_param = Qnil; |
| 3071 | 3071 | ||
| @@ -3075,14 +3075,20 @@ x_default_font_parameter (f, parms) | |||
| 3075 | regardless of font-use-system-font because .emacs may not have been | 3075 | regardless of font-use-system-font because .emacs may not have been |
| 3076 | read yet. */ | 3076 | read yet. */ |
| 3077 | const char *system_font = xsettings_get_system_font (); | 3077 | const char *system_font = xsettings_get_system_font (); |
| 3078 | if (system_font) font_param = make_string (system_font, | 3078 | if (system_font) |
| 3079 | strlen (system_font)); | 3079 | { |
| 3080 | char *name = xstrdup (system_font); | ||
| 3081 | font = font_open_by_name (f, name); | ||
| 3082 | got_from_system = ! NILP (font); | ||
| 3083 | free (name); | ||
| 3084 | } | ||
| 3080 | } | 3085 | } |
| 3081 | |||
| 3082 | font = !NILP (font_param) ? font_param | ||
| 3083 | : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); | ||
| 3084 | 3086 | ||
| 3085 | if (! STRINGP (font)) | 3087 | if (NILP (font)) |
| 3088 | font = !NILP (font_param) ? font_param | ||
| 3089 | : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); | ||
| 3090 | |||
| 3091 | if (! FONTP (font) && ! STRINGP (font)) | ||
| 3086 | { | 3092 | { |
| 3087 | char *names[] | 3093 | char *names[] |
| 3088 | = { | 3094 | = { |
| @@ -3120,8 +3126,8 @@ x_default_font_parameter (f, parms) | |||
| 3120 | } | 3126 | } |
| 3121 | 3127 | ||
| 3122 | x_default_parameter (f, parms, Qfont, font, | 3128 | x_default_parameter (f, parms, Qfont, font, |
| 3123 | got_from_gconf ? NULL : "font", | 3129 | got_from_system ? NULL : "font", |
| 3124 | got_from_gconf ? NULL : "Font", | 3130 | got_from_system ? NULL : "Font", |
| 3125 | RES_TYPE_STRING); | 3131 | RES_TYPE_STRING); |
| 3126 | } | 3132 | } |
| 3127 | 3133 | ||