From 4270727858c1c03f9df591c2fdfa0b9c3993348c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 6 Jan 2010 17:03:26 +0100 Subject: [PATCH] Fixing user-spec for fonts instead of using name. --- lisp/font-setting.el | 2 +- src/font.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/font-setting.el b/lisp/font-setting.el index a0446e55e50..23c169f36fe 100644 --- a/lisp/font-setting.el +++ b/lisp/font-setting.el @@ -57,7 +57,7 @@ current form for the frame (i.e. hinting or somesuch changed)." (if (display-graphic-p f) (let* ((frame-font (or (font-get (face-attribute 'default :font f - 'default) :name) + 'default) :user-spec) (frame-parameter f 'font-parameter))) (font-to-set (if set-font new-font diff --git a/src/font.c b/src/font.c index 3a8f73a6b03..ec4cb874b52 100644 --- a/src/font.c +++ b/src/font.c @@ -143,6 +143,8 @@ Lisp_Object Qc, Qm, Qp, Qd; characters; used in xfont.c and ftfont.c. */ Lisp_Object Qja, Qko; +Lisp_Object QCuser_spec; + Lisp_Object Vfont_encoding_alist; /* Alist of font registry symbol and the corresponding charsets @@ -3161,6 +3163,7 @@ font_spec_from_name (font_name) if (font_parse_name ((char *) SDATA (font_name), spec) == -1) return Qnil; font_put_extra (spec, QCname, font_name); + font_put_extra (spec, QCuser_spec, font_name); return spec; } @@ -3174,14 +3177,13 @@ font_clear_prop (attrs, prop) if (! FONTP (font)) return; -#if 0 + if (! NILP (Ffont_get (font, QCname))) { font = Fcopy_font_spec (font); font_put_extra (font, QCname, Qnil); } -#endif if (NILP (AREF (font, prop)) && prop != FONT_FAMILY_INDEX && prop != FONT_FOUNDRY_INDEX @@ -3539,8 +3541,8 @@ font_load_for_lface (f, attrs, spec) entity = font_open_for_lface (f, entity, attrs, spec); if (!NILP (entity)) { - name = Ffont_get (spec, QCname); - if (STRINGP (name)) font_put_extra (entity, QCname, name); + name = Ffont_get (spec, QCuser_spec); + if (STRINGP (name)) font_put_extra (entity, QCuser_spec, name); } return entity; } @@ -3614,7 +3616,7 @@ font_open_by_name (f, name) ret = font_open_by_spec (f, spec); /* Do not loose name originally put in. */ if (!NILP (ret)) - font_put_extra (ret, QCname, args[1]); + font_put_extra (ret, QCuser_spec, args[1]); return ret; } @@ -5269,6 +5271,8 @@ syms_of_font () DEFSYM (Qja, "ja"); DEFSYM (Qko, "ko"); + DEFSYM (QCuser_spec, "user-spec"); + staticpro (&null_vector); null_vector = Fmake_vector (make_number (0), Qnil); -- 2.11.4.GIT