= (struct font *) allocate_pseudovector (size, FONT_OBJECT_MAX, PVEC_FONT);
int i;
+ /* GC can happen before the driver is set up,
+ so avoid dangling pointer here (Bug#17771). */
+ font->driver = NULL;
XSETFONT (font_object, font);
if (! NILP (entity))
/* This code is similar to intern function from lread.c. */
obarray = check_obarray (Vobarray);
parse_str_as_multibyte ((unsigned char *) str, len, &nchars, &nbytes);
- tem = oblookup (obarray, str,
- (len == nchars || len != nbytes) ? len : nchars, len);
-
- if (SYMBOLP (tem))
- return tem;
- if (len == nchars || len != nbytes)
- tem = make_unibyte_string (str, len);
- else
- tem = make_multibyte_string (str, nchars, len);
+ tem = make_specified_string (str, nchars, len,
+ len != nchars && len == nbytes);
return Fintern (tem, obarray);
}
ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
entity = assoc_no_quit (work, XCDR (cache));
if (CONSP (entity))
- entity = XCDR (entity);
+ entity = AREF (XCDR (entity), 0);
else
{
entity = driver_list->driver->match (f, work);
{
if (face->font->driver->done_face)
face->font->driver->done_face (f, face);
- face->extra = NULL;
}
void
syms_of_font (void)
{
+#include "font.x"
+
sort_shift_bits[FONT_TYPE_INDEX] = 0;
sort_shift_bits[FONT_SLANT_INDEX] = 2;
sort_shift_bits[FONT_WEIGHT_INDEX] = 9;
#endif /* HAVE_LIBOTF */
#endif /* 0 */
- defsubr (&Sfontp);
- defsubr (&Sfont_spec);
- defsubr (&Sfont_get);
-#ifdef HAVE_WINDOW_SYSTEM
- defsubr (&Sfont_face_attributes);
-#endif
- defsubr (&Sfont_put);
- defsubr (&Slist_fonts);
- defsubr (&Sfont_family_list);
- defsubr (&Sfind_font);
- defsubr (&Sfont_xlfd_name);
- defsubr (&Sclear_font_cache);
- defsubr (&Sfont_shape_gstring);
- defsubr (&Sfont_variation_glyphs);
-#if 0
- defsubr (&Sfont_drive_otf);
- defsubr (&Sfont_otf_alternates);
-#endif /* 0 */
-
-#ifdef FONT_DEBUG
- defsubr (&Sopen_font);
- defsubr (&Sclose_font);
- defsubr (&Squery_font);
- defsubr (&Sfont_get_glyphs);
- defsubr (&Sfont_match_p);
- defsubr (&Sfont_at);
-#if 0
- defsubr (&Sdraw_string);
-#endif
- defsubr (&Sframe_font_cache);
-#endif /* FONT_DEBUG */
-#ifdef HAVE_WINDOW_SYSTEM
- defsubr (&Sfont_info);
-#endif
-
DEFVAR_LISP ("font-encoding-alist", Vfont_encoding_alist,
doc: /*
Alist of fontname patterns vs the corresponding encoding and repertory info.
[NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...]
NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. */);
Vfont_weight_table = BUILD_STYLE_TABLE (weight_table);
- XSYMBOL (intern_c_string ("font-weight-table"))->constant = 1;
+ SET_SYMBOL_CONSTANT (XSYMBOL (intern_c_string ("font-weight-table")), 1);
DEFVAR_LISP_NOPRO ("font-slant-table", Vfont_slant_table,
doc: /* Vector of font slant symbols vs the corresponding numeric values.
See `font-weight-table' for the format of the vector. */);
Vfont_slant_table = BUILD_STYLE_TABLE (slant_table);
- XSYMBOL (intern_c_string ("font-slant-table"))->constant = 1;
+ SET_SYMBOL_CONSTANT (XSYMBOL (intern_c_string ("font-slant-table")), 1);
DEFVAR_LISP_NOPRO ("font-width-table", Vfont_width_table,
doc: /* Alist of font width symbols vs the corresponding numeric values.
See `font-weight-table' for the format of the vector. */);
Vfont_width_table = BUILD_STYLE_TABLE (width_table);
- XSYMBOL (intern_c_string ("font-width-table"))->constant = 1;
+ SET_SYMBOL_CONSTANT (XSYMBOL (intern_c_string ("font-width-table")), 1);
staticpro (&font_style_table);
font_style_table = make_uninit_vector (3);