/[emacs]/emacs/src/xfns.c
ViewVC logotype

Diff of /emacs/src/xfns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.539.2.8 by fx, Sat Oct 5 14:38:51 2002 UTC revision 1.539.2.9 by handa, Fri Jan 10 07:20:25 2003 UTC
# Line 1988  x_set_font (f, arg, oldval) Line 1988  x_set_font (f, arg, oldval)
1988    
1989    BLOCK_INPUT;    BLOCK_INPUT;
1990    result = (STRINGP (fontset_name)    result = (STRINGP (fontset_name)
1991              ? x_new_fontset (f, XSTRING (fontset_name)->data)              ? x_new_fontset (f, fontset_name)
1992              : x_new_fontset (f, XSTRING (arg)->data));              : x_new_fontset (f, arg));
1993    UNBLOCK_INPUT;    UNBLOCK_INPUT;
1994        
1995    if (EQ (result, Qnil))    if (EQ (result, Qnil))
# Line 4424  This function is an internal primitive-- Line 4424  This function is an internal primitive--
4424    {    {
4425      Lisp_Object font;      Lisp_Object font;
4426    
4427      font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);      font = x_get_arg (dpyinfo, parms, Qfont,
4428                          "font", "Font", RES_TYPE_STRING);
4429    
4430      BLOCK_INPUT;      /* If the caller has specified no font, try out fonts which we
4431      /* First, try whatever font the caller has specified.  */         hope have bold and italic variations.  */
     if (STRINGP (font))  
       font = x_new_fontset (f, XSTRING (font)->data);  
       
     /* Try out a font which we hope has bold and italic variations.  */  
     if (!STRINGP (font))  
       font = x_new_fontset (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1");  
4432      if (!STRINGP (font))      if (!STRINGP (font))
4433        font = x_new_fontset (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");        {
4434      if (! STRINGP (font))          char *names[]
4435        font = x_new_fontset (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");            = { "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
4436      if (! STRINGP (font))                "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
4437        /* This was formerly the first thing tried, but it finds too many fonts                "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
4438           and takes too long.  */                /* This was formerly the first thing tried, but it finds
4439        font = x_new_fontset (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1");                   too many fonts and takes too long.  */
4440      /* If those didn't work, look for something which will at least work.  */                "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
4441      if (! STRINGP (font))                /* If those didn't work, look for something which will
4442        font = x_new_fontset (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1");                   at least work.  */
4443      UNBLOCK_INPUT;                "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
4444      if (! STRINGP (font))                NULL };
4445        font = build_string ("fixed");          int i;
4446    
4447            BLOCK_INPUT;
4448            for (i = 0; names[i]; i++)
4449              {
4450                Lisp_Object list;
4451    
4452                list = x_list_fonts (f, build_string (names[i]), 0, 1);
4453                if (CONSP (list))
4454                  {
4455                    font = XCAR (list);
4456                    break;
4457                  }
4458              }
4459            UNBLOCK_INPUT;
4460            if (! STRINGP (font))
4461              font = build_string ("fixed");
4462          }
4463      x_default_parameter (f, parms, Qfont, font,      x_default_parameter (f, parms, Qfont, font,
4464                           "font", "Font", RES_TYPE_STRING);                           "font", "Font", RES_TYPE_STRING);
4465    }    }
# Line 11019  x_create_tip_frame (dpyinfo, parms, text Line 11030  x_create_tip_frame (dpyinfo, parms, text
11030        {        {
11031          tem = Fquery_fontset (font, Qnil);          tem = Fquery_fontset (font, Qnil);
11032          if (STRINGP (tem))          if (STRINGP (tem))
11033            font = x_new_fontset (f, XSTRING (tem)->data);            font = x_new_fontset (f, tem);
11034          else          else
11035            font = x_new_font (f, XSTRING (font)->data);            font = x_new_fontset (f, font);
11036        }        }
11037            
11038      /* Try out a font which we hope has bold and italic variations.  */      /* Try out a font which we hope has bold and italic variations.  */

Legend:
Removed from v.1.539.2.8  
changed lines
  Added in v.1.539.2.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26