summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2009-11-23 08:55:08 +0000
committerJan Djärv <jan.h.d@swipnet.se>2009-11-23 08:55:08 +0000
commit581e51e8918b3ba9b58e67768a1de39ce5f1cbd3 (patch)
treeb210e82974c9e4ab1d3cc1c0a9e86348a425526b /src/frame.c
parent0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75 (diff)
downloademacs-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/frame.c')
-rw-r--r--src/frame.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c
index 323bfc1c37d..2a72e43cd40 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -205,6 +205,8 @@ extern Lisp_Object get_minibuffer ();
extern Lisp_Object Fhandle_switch_frame ();
extern Lisp_Object Fredirect_frame_focus ();
extern Lisp_Object x_get_focus_frame ();
+extern Lisp_Object QCname, Qfont_param;
+
DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
doc: /* Return non-nil if OBJECT is a frame.
@@ -3359,7 +3361,7 @@ x_set_font (f, arg, oldval)
struct frame *f;
Lisp_Object arg, oldval;
{
- Lisp_Object frame, font_object;
+ Lisp_Object frame, font_object, font_param = Qnil;
int fontset = -1;
/* Set the frame parameter back to the old value because we may
@@ -3371,6 +3373,7 @@ x_set_font (f, arg, oldval)
never fail. */
if (STRINGP (arg))
{
+ font_param = arg;
fontset = fs_query_fontset (arg, 0);
if (fontset < 0)
{
@@ -3401,10 +3404,12 @@ x_set_font (f, arg, oldval)
error ("Unknown fontset: %s", SDATA (XCAR (arg)));
font_object = XCDR (arg);
arg = AREF (font_object, FONT_NAME_INDEX);
+ font_param = Ffont_get (font_object, QCname);
}
else if (FONT_OBJECT_P (arg))
{
font_object = arg;
+ font_param = Ffont_get (font_object, QCname);
/* This is to store the XLFD font name in the frame parameter for
backward compatibility. We should store the font-object
itself in the future. */
@@ -3429,6 +3434,9 @@ x_set_font (f, arg, oldval)
x_new_font (f, font_object, fontset);
store_frame_param (f, Qfont, arg);
+#ifdef HAVE_X_WINDOWS
+ store_frame_param (f, Qfont_param, font_param);
+#endif
/* Recalculate toolbar height. */
f->n_tool_bar_rows = 0;
/* Ensure we redraw it. */