summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-07-01 21:12:55 +0300
committerEli Zaretskii <eliz@gnu.org>2019-07-01 21:12:55 +0300
commit0f830340afc48461c021b858370004972162837c (patch)
treea2cbda5b057e72543df82c1cf3e25fdb3a3310ea /src
parent50c98fdc0f9a7da65521fa1e4965e2f27b5557d8 (diff)
downloademacs-0f830340afc48461c021b858370004972162837c.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c34
-rw-r--r--src/hbfont.c6
2 files changed, 23 insertions, 17 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 137d2895932..828e7fe70cc 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -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
diff --git a/src/hbfont.c b/src/hbfont.c
index 455c1a7a554..db10f92e313 100644
--- a/src/hbfont.c
+++ b/src/hbfont.c
@@ -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