# HG changeset patch # User Kenichi Handa # Date 1150460848 0 # Node ID 4c9461c6aef4fa9a30b4627836904b080c25738b # Parent 9430e7e49983c252bed3e95d35934446eb02e248 (new_fontset_from_font) [USE_FONT_BACKEND]: Argument F deleted. Don't call Fnew_fontset. Instead, directly call make_fontset. diff -r 9430e7e49983 -r 4c9461c6aef4 src/fontset.c --- a/src/fontset.c Fri Jun 16 12:25:51 2006 +0000 +++ b/src/fontset.c Fri Jun 16 12:27:28 2006 +0000 @@ -1834,17 +1834,39 @@ #ifdef USE_FONT_BACKEND int -new_fontset_from_font (f, font_object) - FRAME_PTR f; +new_fontset_from_font (font_object) Lisp_Object font_object; { - Lisp_Object xlfd = Ffont_xlfd_name (font_object); - int id = new_fontset_from_font_name (xlfd); - Lisp_Object fontset = FONTSET_FROM_ID (id); + Lisp_Object font_name = font_get_name (font_object); + Lisp_Object font_spec = font_get_spec (font_object); + Lisp_Object short_name, name, fontset; + + if (NILP (auto_fontset_alist)) + short_name = build_string ("fontset-startup"); + else + { + char temp[32]; + int len = XINT (Flength (auto_fontset_alist)); - FONTSET_ASCII (fontset) = build_string (font_get_name (font_object)); + sprintf (temp, "fontset-auto%d", len); + short_name = build_string (temp); + } + ASET (font_spec, FONT_REGISTRY_INDEX, short_name); + name = Ffont_xlfd_name (font_spec); + if (NILP (name)) + { + int i; - return id; + for (i = 0; i < FONT_SIZE_INDEX; i++) + if ((i != FONT_FAMILY_INDEX) && (i != FONT_REGISTRY_INDEX)) + ASET (font_spec, i, Qnil); + name = Ffont_xlfd_name (font_spec); + if (NILP (name)) + abort (); + } + fontset = make_fontset (Qnil, name, Qnil); + FONTSET_ASCII (fontset) = font_name; + return XINT (FONTSET_ID (fontset)); } struct font *