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

Diff of /emacs/src/xfaces.c

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

revision 1.266 by miles, Sun Nov 17 23:51:19 2002 UTC revision 1.267 by lektu, Tue Feb 4 14:03:17 2003 UTC
# Line 494  static int font_list_1 P_ ((struct frame Line 494  static int font_list_1 P_ ((struct frame
494                              Lisp_Object, struct font_name **));                              Lisp_Object, struct font_name **));
495  static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object,  static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object,
496                            Lisp_Object, struct font_name **));                            Lisp_Object, struct font_name **));
497  static int try_font_list P_ ((struct frame *, Lisp_Object *,  static int try_font_list P_ ((struct frame *, Lisp_Object *,
498                                Lisp_Object, Lisp_Object, struct font_name **,                                Lisp_Object, Lisp_Object, struct font_name **,
499                                int));                                int));
500  static int try_alternative_families P_ ((struct frame *f, Lisp_Object,  static int try_alternative_families P_ ((struct frame *f, Lisp_Object,
# Line 974  clear_face_cache (clear_fonts_p) Line 974  clear_face_cache (clear_fonts_p)
974        || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)        || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)
975      {      {
976        struct x_display_info *dpyinfo;        struct x_display_info *dpyinfo;
977          
978        /* Fonts are common for frames on one display, i.e. on        /* Fonts are common for frames on one display, i.e. on
979           one X screen.  */           one X screen.  */
980        for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)        for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
981          if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS)          if (dpyinfo->n_fonts > CLEAR_FONT_TABLE_NFONTS)
982            clear_font_table (dpyinfo);            clear_font_table (dpyinfo);
983          
984        /* From time to time see if we can unload some fonts.  This also        /* From time to time see if we can unload some fonts.  This also
985           frees all realized faces on all frames.  Fonts needed by           frees all realized faces on all frames.  Fonts needed by
986           faces will be loaded again when faces are realized again.  */           faces will be loaded again when faces are realized again.  */
# Line 1401  tty_defined_color (f, color_name, color_ Line 1401  tty_defined_color (f, color_name, color_
1401    int status = 1;    int status = 1;
1402    
1403    /* Defaults.  */    /* Defaults.  */
1404    color_def->pixel = FACE_TTY_DEFAULT_COLOR;    color_def->pixel = FACE_TTY_DEFAULT_COLOR;
1405    color_def->red = 0;    color_def->red = 0;
1406    color_def->blue = 0;    color_def->blue = 0;
1407    color_def->green = 0;    color_def->green = 0;
# Line 2238  xlfd_point_size (f, font) Line 2238  xlfd_point_size (f, font)
2238      }      }
2239    else    else
2240      pixel = atoi (pixel_field);      pixel = atoi (pixel_field);
2241      
2242    if (pixel == 0)    if (pixel == 0)
2243      real_pt = 0;      real_pt = 0;
2244    else    else
# Line 2306  split_font_name (f, font, numeric_p) Line 2306  split_font_name (f, font, numeric_p)
2306              {              {
2307                char *start, *end;                char *start, *end;
2308                int j;                int j;
2309                  
2310                for (++p; *p && *p != ']'; ++p)                for (++p; *p && *p != ']'; ++p)
2311                  if (*p == '~')                  if (*p == '~')
2312                    *p = '-';                    *p = '-';
# Line 2689  concat_font_list (fonts1, nfonts1, fonts Line 2689  concat_font_list (fonts1, nfonts1, fonts
2689    
2690     If REGISTRY is non-nil, return fonts with that registry and the     If REGISTRY is non-nil, return fonts with that registry and the
2691     alternative registries from Vface_alternative_font_registry_alist.     alternative registries from Vface_alternative_font_registry_alist.
2692      
2693     If REGISTRY is nil return fonts of any registry.     If REGISTRY is nil return fonts of any registry.
2694    
2695     Set *FONTS to a vector of font_name structures allocated from the     Set *FONTS to a vector of font_name structures allocated from the
# Line 2703  font_list (f, pattern, family, registry, Line 2703  font_list (f, pattern, family, registry,
2703       struct font_name **fonts;       struct font_name **fonts;
2704  {  {
2705    int nfonts = font_list_1 (f, pattern, family, registry, fonts);    int nfonts = font_list_1 (f, pattern, family, registry, fonts);
2706      
2707    if (!NILP (registry)    if (!NILP (registry)
2708        && CONSP (Vface_alternative_font_registry_alist))        && CONSP (Vface_alternative_font_registry_alist))
2709      {      {
# Line 3167  lface_fully_specified_p (attrs) Line 3167  lface_fully_specified_p (attrs)
3167    for (i = 1; i < LFACE_VECTOR_SIZE; ++i)    for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
3168      if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX      if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX
3169          && i != LFACE_AVGWIDTH_INDEX)          && i != LFACE_AVGWIDTH_INDEX)
3170        if (UNSPECIFIEDP (attrs[i]))        if (UNSPECIFIEDP (attrs[i]))
3171          break;          break;
3172    
3173    return i == LFACE_VECTOR_SIZE;    return i == LFACE_VECTOR_SIZE;
# Line 4308  set_font_frame_param (frame, lface) Line 4308  set_font_frame_param (frame, lface)
4308      {      {
4309        Lisp_Object font_name;        Lisp_Object font_name;
4310        char *font;        char *font;
4311          
4312        if (STRINGP (LFACE_FONT (lface)))        if (STRINGP (LFACE_FONT (lface)))
4313          font_name = LFACE_FONT (lface);          font_name = LFACE_FONT (lface);
4314        else        else
# Line 4322  set_font_frame_param (frame, lface) Line 4322  set_font_frame_param (frame, lface)
4322            font_name = build_string (font);            font_name = build_string (font);
4323            xfree (font);            xfree (font);
4324          }          }
4325      
4326        Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil));        Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font_name), Qnil));
4327      }      }
4328  }  }
# Line 4524  x_update_menu_appearance (f) Line 4524  x_update_menu_appearance (f)
4524  #else  #else
4525        const char *popup_path = "menu.popup";        const char *popup_path = "menu.popup";
4526  #endif  #endif
4527          
4528        if (STRINGP (LFACE_FOREGROUND (lface)))        if (STRINGP (LFACE_FOREGROUND (lface)))
4529          {          {
4530            sprintf (line, "%s.%s*foreground: %s",            sprintf (line, "%s.%s*foreground: %s",
# Line 4548  x_update_menu_appearance (f) Line 4548  x_update_menu_appearance (f)
4548            XrmPutLineResource (&rdb, line);            XrmPutLineResource (&rdb, line);
4549            changed_p = 1;            changed_p = 1;
4550          }          }
4551              
4552        if (face->font_name        if (face->font_name
4553            && (!UNSPECIFIEDP (LFACE_FAMILY (lface))            && (!UNSPECIFIEDP (LFACE_FAMILY (lface))
4554                || !UNSPECIFIEDP (LFACE_SWIDTH (lface))                || !UNSPECIFIEDP (LFACE_SWIDTH (lface))
# Line 4579  x_update_menu_appearance (f) Line 4579  x_update_menu_appearance (f)
4579  #endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */  #endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */
4580    
4581    
4582  DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p,  DEFUN ("face-attribute-relative-p", Fface_attribute_relative_p,
4583         Sface_attribute_relative_p,         Sface_attribute_relative_p,
4584         2, 2, 0,         2, 2, 0,
4585         doc: /* Return non-nil if face ATTRIBUTE VALUE is relative.  */)         doc: /* Return non-nil if face ATTRIBUTE VALUE is relative.  */)
# Line 5252  substitution of a `dim' face for italic. Line 5252  substitution of a `dim' face for italic.
5252        else if (weight < XLFD_WEIGHT_MEDIUM)        else if (weight < XLFD_WEIGHT_MEDIUM)
5253          test_caps = TTY_CAP_DIM;          test_caps = TTY_CAP_DIM;
5254      }      }
5255          
5256    /* underlining */    /* underlining */
5257    val = attrs[LFACE_UNDERLINE_INDEX];    val = attrs[LFACE_UNDERLINE_INDEX];
5258    if (!UNSPECIFIEDP (val) && !NILP (val))    if (!UNSPECIFIEDP (val) && !NILP (val))
# Line 6286  best_matching_font (f, attrs, fonts, nfo Line 6286  best_matching_font (f, attrs, fonts, nfo
6286     REGISTRY, if a string, specifies a font registry and encoding to     REGISTRY, if a string, specifies a font registry and encoding to
6287     match.  A value of nil means include fonts of any registry and     match.  A value of nil means include fonts of any registry and
6288     encoding.     encoding.
6289      
6290     Return in *FONTS a pointer to a vector of font_name structures for     Return in *FONTS a pointer to a vector of font_name structures for
6291     the fonts matched.  Value is the number of fonts found.  */     the fonts matched.  Value is the number of fonts found.  */
6292    
# Line 6314  try_alternative_families (f, family, reg Line 6314  try_alternative_families (f, family, reg
6314                  nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts);                  nfonts = font_list (f, Qnil, XCAR (alter), registry, fonts);
6315              }              }
6316          }          }
6317          
6318        /* Try scalable fonts before giving up.  */        /* Try scalable fonts before giving up.  */
6319        if (nfonts == 0 && NILP (Vscalable_fonts_allowed))        if (nfonts == 0 && NILP (Vscalable_fonts_allowed))
6320          {          {
# Line 6337  try_alternative_families (f, family, reg Line 6337  try_alternative_families (f, family, reg
6337     REGISTRY, if a string, specifies a font registry and encoding to     REGISTRY, if a string, specifies a font registry and encoding to
6338     match.  A value of nil means include fonts of any registry and     match.  A value of nil means include fonts of any registry and
6339     encoding.     encoding.
6340      
6341     If PREFER_FACE_FAMILY is nonzero, perfer face's family to FAMILY.     If PREFER_FACE_FAMILY is nonzero, perfer face's family to FAMILY.
6342     Otherwise, prefer FAMILY.     Otherwise, prefer FAMILY.
6343    
# Line 6388  try_font_list (f, attrs, family, registr Line 6388  try_font_list (f, attrs, family, registr
6388          family = build_string ("fixed");          family = build_string ("fixed");
6389        nfonts = font_list (f, Qnil, family, registry, fonts);        nfonts = font_list (f, Qnil, family, registry, fonts);
6390      }      }
6391          
6392    /* Try any family with the given registry.  */    /* Try any family with the given registry.  */
6393    if (nfonts == 0)    if (nfonts == 0)
6394      nfonts = font_list (f, Qnil, Qnil, registry, fonts);      nfonts = font_list (f, Qnil, Qnil, registry, fonts);
# Line 6447  choose_face_font (f, attrs, fontset, c, Line 6447  choose_face_font (f, attrs, fontset, c,
6447        xassert (!SINGLE_BYTE_CHAR_P (c));        xassert (!SINGLE_BYTE_CHAR_P (c));
6448        return NULL;        return NULL;
6449      }      }
6450      
6451    /* If what we got is a name pattern, return it.  */    /* If what we got is a name pattern, return it.  */
6452    if (STRINGP (pattern))    if (STRINGP (pattern))
6453      return xstrdup (SDATA (pattern));      return xstrdup (SDATA (pattern));
# Line 6510  realize_basic_faces (f) Line 6510  realize_basic_faces (f)
6510            x_update_menu_appearance (f);            x_update_menu_appearance (f);
6511  #endif  #endif
6512          }          }
6513          
6514        success_p = 1;        success_p = 1;
6515      }      }
6516    
# Line 6954  map_tty_color (f, face, idx, defaulted) Line 6954  map_tty_color (f, face, idx, defaulted)
6954        pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR;        pixel = default_pixel = FACE_TTY_DEFAULT_BG_COLOR;
6955        default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR;        default_other_pixel = FACE_TTY_DEFAULT_FG_COLOR;
6956      }      }
6957      
6958    XSETFRAME (frame, f);    XSETFRAME (frame, f);
6959    color = face->lface[idx];    color = face->lface[idx];
6960      
6961    if (STRINGP (color)    if (STRINGP (color)
6962        && SCHARS (color)        && SCHARS (color)
6963        && CONSP (Vtty_defined_color_alist)        && CONSP (Vtty_defined_color_alist)
# Line 7052  realize_tty_face (cache, attrs, c) Line 7052  realize_tty_face (cache, attrs, c)
7052    /* Map color names to color indices.  */    /* Map color names to color indices.  */
7053    map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted);    map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted);
7054    map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted);    map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted);
7055      
7056    /* Swap colors if face is inverse-video.  If the colors are taken    /* Swap colors if face is inverse-video.  If the colors are taken
7057       from the frame colors, they are already inverted, since the       from the frame colors, they are already inverted, since the
7058       frame-creation function calls x-handle-reverse-video.  */       frame-creation function calls x-handle-reverse-video.  */

Legend:
Removed from v.1.266  
changed lines
  Added in v.1.267

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