aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2010-01-06 17:03:26 +0100
committerJan Djärv2010-01-06 17:03:26 +0100
commit4270727858c1c03f9df591c2fdfa0b9c3993348c (patch)
tree965ba7819305555efbaa7c1543d4a0f349f662c7 /src
parentc0e6d47dc5e349881973bd9f9e64815c33c6a4f7 (diff)
downloademacs-4270727858c1c03f9df591c2fdfa0b9c3993348c.tar.gz
emacs-4270727858c1c03f9df591c2fdfa0b9c3993348c.zip
Fixing user-spec for fonts instead of using name.
Diffstat (limited to 'src')
-rw-r--r--src/font.c14
1 files changed, 9 insertions, 5 deletions
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;
143 characters; used in xfont.c and ftfont.c. */ 143 characters; used in xfont.c and ftfont.c. */
144Lisp_Object Qja, Qko; 144Lisp_Object Qja, Qko;
145 145
146Lisp_Object QCuser_spec;
147
146Lisp_Object Vfont_encoding_alist; 148Lisp_Object Vfont_encoding_alist;
147 149
148/* Alist of font registry symbol and the corresponding charsets 150/* Alist of font registry symbol and the corresponding charsets
@@ -3161,6 +3163,7 @@ font_spec_from_name (font_name)
3161 if (font_parse_name ((char *) SDATA (font_name), spec) == -1) 3163 if (font_parse_name ((char *) SDATA (font_name), spec) == -1)
3162 return Qnil; 3164 return Qnil;
3163 font_put_extra (spec, QCname, font_name); 3165 font_put_extra (spec, QCname, font_name);
3166 font_put_extra (spec, QCuser_spec, font_name);
3164 return spec; 3167 return spec;
3165} 3168}
3166 3169
@@ -3174,14 +3177,13 @@ font_clear_prop (attrs, prop)
3174 3177
3175 if (! FONTP (font)) 3178 if (! FONTP (font))
3176 return; 3179 return;
3177#if 0 3180
3178 if (! NILP (Ffont_get (font, QCname))) 3181 if (! NILP (Ffont_get (font, QCname)))
3179 { 3182 {
3180 font = Fcopy_font_spec (font); 3183 font = Fcopy_font_spec (font);
3181 font_put_extra (font, QCname, Qnil); 3184 font_put_extra (font, QCname, Qnil);
3182 } 3185 }
3183 3186
3184#endif
3185 if (NILP (AREF (font, prop)) 3187 if (NILP (AREF (font, prop))
3186 && prop != FONT_FAMILY_INDEX 3188 && prop != FONT_FAMILY_INDEX
3187 && prop != FONT_FOUNDRY_INDEX 3189 && prop != FONT_FOUNDRY_INDEX
@@ -3539,8 +3541,8 @@ font_load_for_lface (f, attrs, spec)
3539 entity = font_open_for_lface (f, entity, attrs, spec); 3541 entity = font_open_for_lface (f, entity, attrs, spec);
3540 if (!NILP (entity)) 3542 if (!NILP (entity))
3541 { 3543 {
3542 name = Ffont_get (spec, QCname); 3544 name = Ffont_get (spec, QCuser_spec);
3543 if (STRINGP (name)) font_put_extra (entity, QCname, name); 3545 if (STRINGP (name)) font_put_extra (entity, QCuser_spec, name);
3544 } 3546 }
3545 return entity; 3547 return entity;
3546} 3548}
@@ -3614,7 +3616,7 @@ font_open_by_name (f, name)
3614 ret = font_open_by_spec (f, spec); 3616 ret = font_open_by_spec (f, spec);
3615 /* Do not loose name originally put in. */ 3617 /* Do not loose name originally put in. */
3616 if (!NILP (ret)) 3618 if (!NILP (ret))
3617 font_put_extra (ret, QCname, args[1]); 3619 font_put_extra (ret, QCuser_spec, args[1]);
3618 3620
3619 return ret; 3621 return ret;
3620} 3622}
@@ -5269,6 +5271,8 @@ syms_of_font ()
5269 DEFSYM (Qja, "ja"); 5271 DEFSYM (Qja, "ja");
5270 DEFSYM (Qko, "ko"); 5272 DEFSYM (Qko, "ko");
5271 5273
5274 DEFSYM (QCuser_spec, "user-spec");
5275
5272 staticpro (&null_vector); 5276 staticpro (&null_vector);
5273 null_vector = Fmake_vector (make_number (0), Qnil); 5277 null_vector = Fmake_vector (make_number (0), Qnil);
5274 5278