range of characters in this fontset, but may be available in the
default fontset.
+ A fontset has 8 extra slots.
- A fontset has 9 extra slots.
-
- The 1st slot: the ID number of the fontset
+ The 1st slot:
+ base: the ID number of the fontset
+ realized: Likewise
The 2nd slot:
base: the name of the fontset
realized: nil
The 3rd slot:
- base: nil
- realized: the base fontset
+ base: the font name for ASCII characters
+ realized: nil
The 4th slot:
base: nil
- realized: the frame that the fontset belongs to
+ realized: the base fontset
The 5th slot:
- base: the font name for ASCII characters
- realized: nil
+ base: nil
+ realized: the frame that the fontset belongs to
The 6th slot:
base: nil
has no font in a realized fontset.
The 7th slot:
- base: nil
- realized: Alist of font index vs the corresponding repertory
- char-table.
-
- The 8th slot:
base: nil
realized: If the base is not the default fontset, a fontset
- realized from the default fontset, else nil.
+ realized from the default fontset, else nil.
- The 9th slot:
+ The 8th slot:
base: Same as element value (but for fallback fonts).
realized: Likewise.
/* If PATTERN is not full XLFD we convert "*" to ".*". Otherwise
we convert "*" to "[^-]*" which is much faster in regular
expression matching. */
- if (ndashes < 14)
- p1 = regex = alloca (SBYTES (pattern) + 2 * nstars + 2 * nescs + 1);
- else
- p1 = regex = alloca (SBYTES (pattern) + 5 * nstars + 2 * nescs + 1);
+ ptrdiff_t regexsize = (SBYTES (pattern)
+ + (ndashes < 14 ? 2 : 5) * nstars
+ + 2 * nescs + 1);
+ USE_SAFE_ALLOCA;
+ p1 = regex = SAFE_ALLOCA (regexsize);
*p1++ = '^';
for (p0 = SDATA (pattern); *p0; p0++)
Vcached_fontset_data = Fcons (build_string (SSDATA (pattern)),
build_string ((char *) regex));
+ SAFE_FREE ();
}
return CACHED_FONTSET_REGEX;
registry = AREF (font_spec, FONT_REGISTRY_INDEX);
if (! NILP (registry))
registry = Fdowncase (SYMBOL_NAME (registry));
- encoding = find_font_encoding (concat3 (family, build_string ("-"),
- registry));
+ AUTO_STRING (dash, "-");
+ encoding = find_font_encoding (concat3 (family, dash, registry));
if (NILP (encoding))
encoding = Qascii;
if (ascii_changed)
{
- Lisp_Object tail, fr, alist;
+ Lisp_Object tail, fr;
int fontset_id = XINT (FONTSET_ID (fontset));
set_fontset_ascii (fontset, fontname);
if (! NILP (font_object))
{
update_auto_fontset_alist (font_object, fontset);
- alist = list1 (Fcons (Qfont, Fcons (name, font_object)));
- Fmodify_frame_parameters (fr, alist);
+ AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object));
+ Fmodify_frame_parameters (fr, arg);
}
}
}
/* Recode fontsets realized on FRAME from the base fontset FONTSET
in the table `realized'. */
- realized[0] = alloca (word_size * ASIZE (Vfontset_table));
+ USE_SAFE_ALLOCA;
+ SAFE_ALLOCA_LISP (realized[0], 2 * ASIZE (Vfontset_table));
+ realized[1] = realized[0] + ASIZE (Vfontset_table);
for (i = j = 0; i < ASIZE (Vfontset_table); i++)
{
elt = FONTSET_FROM_ID (i);
}
realized[0][j] = Qnil;
- realized[1] = alloca (word_size * ASIZE (Vfontset_table));
for (i = j = 0; ! NILP (realized[0][i]); i++)
{
elt = FONTSET_DEFAULT (realized[0][i]);
break;
}
+ SAFE_FREE ();
return tables[0];
}