int from1, to1;
do {
+ from1 = from, to1 = to;
args[idx] = char_table_ref_and_range (fontset, from, &from1, &to1);
- if (to < to1)
- to1 = to;
char_table_set_range (fontset, from, to1,
NILP (args[idx]) ? args[1 - idx]
: Fvconcat (2, args));
{
Lisp_Object font_group;
Lisp_Object base_fontset;
- int from, to, i;
+ int from = 0, to = MAX_CHAR, i;
xassert (! BASE_FONTSET_P (fontset));
if (c >= 0)
int id, fallback;
{
Lisp_Object elt, vec, font_group;
- int i;
- FRAME_PTR f = XFRAME (FONTSET_FRAME (fontset));
- int charset_matched = -1;
+ int i, charset_matched = -1;
+ FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset)))
+ ? XFRAME (selected_frame) : XFRAME (FONTSET_FRAME (fontset));
font_group = fontset_get_font_group (fontset, fallback ? -1 : c);
if (! CONSP (font_group))
int face_id;
int id;
- if (ASCII_CHAR_P (c))
+ /* If face->fontset is negative (that happens when no font is found
+ for face), just return face->ascii_face because we can't do
+ anything. Perhaps, we should fix the callers to assure
+ that face->fontset is always valid. */
+ if (ASCII_CHAR_P (c) || face->fontset < 0)
return face->ascii_face->id;
xassert (fontset_id_valid_p (face->fontset));
else
{
charset = Fget_char_property (make_number (pos), Qcharset, object);
- if (NILP (charset))
- id = -1;
- else if (CHARSETP (charset))
+ if (CHARSETP (charset))
{
Lisp_Object val;
charset = XCDR (val);
id = XINT (CHARSET_SYMBOL_ID (charset));
}
+ else
+ id = -1;
}
font_deferred_log ("font for", Fcons (make_number (c), charset), Qnil);
else
{
charset = Fget_char_property (make_number (pos), Qcharset, object);
- if (NILP (charset))
- id = -1;
- else if (CHARSETP (charset))
+ if (CHARSETP (charset))
{
Lisp_Object val;
charset = XCDR (val);
id = XINT (CHARSET_SYMBOL_ID (charset));
}
+ else
+ id = -1;
}
font_deferred_log ("font for", Fcons (make_number (c), charset), Qnil);
{
for (c = 0; c <= MAX_CHAR; )
{
- int from, to;
+ int from = c, to = MAX_5_BYTE_CHAR;
if (c <= MAX_5_BYTE_CHAR)
{
val = char_table_ref_and_range (fontsets[k], c, &from, &to);
- if (to > MAX_5_BYTE_CHAR)
- to = MAX_5_BYTE_CHAR;
}
else
{