comparison src/xterm.c @ 89353:f1507fc0d6e6

(x_new_fontset): Change the arg FONTSETNAME to Lisp string. Use new_fontset_from_font_name to create a fontset from a font name.
author Kenichi Handa <handa@m17n.org>
date Fri, 10 Jan 2003 07:22:03 +0000
parents 4f46c53eb254
children 66640ed1aeae
comparison
equal deleted inserted replaced
89352:ffa18ef18e45 89353:f1507fc0d6e6
12319 Qnil. */ 12319 Qnil. */
12320 12320
12321 Lisp_Object 12321 Lisp_Object
12322 x_new_fontset (f, fontsetname) 12322 x_new_fontset (f, fontsetname)
12323 struct frame *f; 12323 struct frame *f;
12324 char *fontsetname; 12324 Lisp_Object fontsetname;
12325 { 12325 {
12326 int fontset = fs_query_fontset (build_string (fontsetname), 0); 12326 int fontset = fs_query_fontset (fontsetname, 0);
12327 Lisp_Object result; 12327 Lisp_Object result;
12328 12328
12329 if (fontset > 0 && f->output_data.x->fontset == fontset) 12329 if (fontset > 0 && f->output_data.x->fontset == fontset)
12330 /* This fontset is already set in frame F. There's nothing more 12330 /* This fontset is already set in frame F. There's nothing more
12331 to do. */ 12331 to do. */
12335 return Qt; 12335 return Qt;
12336 12336
12337 if (fontset >= 0) 12337 if (fontset >= 0)
12338 result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); 12338 result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data));
12339 else 12339 else
12340 result = x_new_font (f, fontsetname); 12340 result = x_new_font (f, XSTRING (fontsetname)->data);
12341 12341
12342 if (!STRINGP (result)) 12342 if (!STRINGP (result))
12343 /* Can't load ASCII font. */ 12343 /* Can't load ASCII font. */
12344 return Qnil; 12344 return Qnil;
12345 12345
12346 fontset = fs_query_fontset (result, 0);
12346 if (fontset < 0) 12347 if (fontset < 0)
12347 { 12348 fontset = new_fontset_from_font_name (result);
12348 Lisp_Object func;
12349
12350 func = intern ("create-fontset-from-ascii-font");
12351 if (! NILP (Ffboundp (func)))
12352 result = call2 (func, result, result);
12353 else
12354 Fnew_fontset (result,
12355 Fcons (Fcons (Qascii, Fcons (result, Qnil)), Qnil));
12356 fontset = fs_query_fontset (result, 0);
12357 }
12358 12349
12359 /* Since x_new_font doesn't update any fontset information, do it now. */ 12350 /* Since x_new_font doesn't update any fontset information, do it now. */
12360 f->output_data.x->fontset = fontset; 12351 f->output_data.x->fontset = fontset;
12361 12352
12362 #ifdef HAVE_X_I18N 12353 #ifdef HAVE_X_I18N