or the charset priorities were changed. */
reorder_font_vector (font_group, face->ascii_face->font);
if (charset_id >= 0)
- /* Find a spec matching with CHARSET_ID to try it at
- first. */
- for (i = 0; i < ASIZE (vec); i++)
- {
- Lisp_Object repertory;
-
- rfont_def = AREF (vec, i);
- if (NILP (rfont_def))
- break;
- repertory = FONT_DEF_REPERTORY (RFONT_DEF_FONT_DEF (rfont_def));
-
- if (FIXNUMP (repertory) && XFIXNUM_RAW (repertory) == charset_id)
- {
- charset_matched = i;
+ {
+ Lisp_Object lcsetid = make_fixnum (charset_id);
+ /* Find a spec matching with CHARSET_ID to try it at first. */
+ for (i = 0; i < ASIZE (vec); i++)
+ {
+ Lisp_Object repertory;
+
+ rfont_def = AREF (vec, i);
+ if (NILP (rfont_def))
break;
- }
- }
+ repertory = FONT_DEF_REPERTORY (RFONT_DEF_FONT_DEF (rfont_def));
+
+ if (EQ (repertory, lcsetid))
+ {
+ charset_matched = i;
+ break;
+ }
+ }
+ }
}
/* Find the first available font in the vector of RFONT-DEF. If
Lisp_Object lglyph = LGSTRING_GLYPH (lgstring, i);
struct font_metrics metrics = {.width = 0};
int xoff, yoff, wadjust;
+ bool new_lglyph = false;
if (NILP (lglyph))
{
+ new_lglyph = true;
lglyph = LGLYPH_NEW ();
LGSTRING_SET_GLYPH (lgstring, i, lglyph);
}
in the original sequence were processed by the composition.
If we don't do this, some of the composed characters will be
displayed again as separate glyphs. */
- if (!(to == text_len - 1 && LGLYPH_TO (lglyph) > to))
+ if (!(!new_lglyph
+ && to == text_len - 1
+ && LGLYPH_TO (lglyph) > to))
LGLYPH_SET_TO (lglyph, to);
/* Not every glyph in a cluster maps directly to a single