Commit 0f830340 authored by Eli Zaretskii's avatar Eli Zaretskii

More XFIXNUM fixes

* src/hbfont.c (hbfont_shape): Don't assume LGLYPH_TO is
always a fixnum.
* src/fontset.c (fontset_find_font): A cleaner test for
matching charset_id.
parent 50c98fdc
......@@ -564,23 +564,25 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face,
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
......
......@@ -512,9 +512,11 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
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);
}
......@@ -556,7 +558,9 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment