#define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface)
-/* Value is the number of elements of VECTOR. */
-
-#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
-
/* Size of hash table of realized faces in face caches (should be a
prime number). */
record that fact in flags of the face so that we don't try to free
these colors. */
-#ifndef MSDOS
-static
-#endif
unsigned long
load_color (struct frame *f, struct face *face, Lisp_Object name,
enum lface_attribute_index target_index)
}
}
+#ifdef HAVE_WINDOW_SYSTEM
-/* Prepare face FACE for subsequent display on frame F. This
- allocated GCs if they haven't been allocated yet or have been freed
- by clearing the face cache. */
+/* Prepare face FACE for subsequent display on frame F. This must be called
+ before using X resources of FACE to allocate GCs if they haven't been
+ allocated yet or have been freed by clearing the face cache. */
void
prepare_face_for_display (struct frame *f, struct face *face)
{
-#ifdef HAVE_WINDOW_SYSTEM
eassert (FRAME_WINDOW_P (f));
if (face->gc == 0)
font_prepare_for_face (f, face);
unblock_input ();
}
-#endif /* HAVE_WINDOW_SYSTEM */
}
-\f
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* Returns the `distance' between the colors X and Y. */
static int
{
Lisp_Object list;
int i;
- int indices[DIM (font_sort_order)];
+ int indices[ARRAYELTS (font_sort_order)];
CHECK_LIST (order);
memset (indices, 0, sizeof indices);
i = 0;
for (list = order;
- CONSP (list) && i < DIM (indices);
+ CONSP (list) && i < ARRAYELTS (indices);
list = XCDR (list), ++i)
{
Lisp_Object attr = XCAR (list);
indices[i] = xlfd;
}
- if (!NILP (list) || i != DIM (indices))
+ if (!NILP (list) || i != ARRAYELTS (indices))
signal_error ("Invalid font sort order", order);
- for (i = 0; i < DIM (font_sort_order); ++i)
+ for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
if (indices[i] == 0)
signal_error ("Invalid font sort order", order);
face = xmalloc (sizeof *face);
*face = *base_face;
face->gc = 0;
- face->extra = NULL;
face->overstrike
= (! NILP (font_object)
&& FONT_WEIGHT_NAME_NUMERIC (face->lface[LFACE_WEIGHT_INDEX]) > 100
int i;
fprintf (stderr, "font selection order: ");
- for (i = 0; i < DIM (font_sort_order); ++i)
+ for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
fprintf (stderr, "%d ", font_sort_order[i]);
fprintf (stderr, "\n");