characters to be composed. FACE, if non-NULL, is a base face of
the character. If STRING is not nil, it is a string containing the
character to check, and CHARPOS and BYTEPOS are indices in the
- string. In that case, FACE must not be NULL. PDIR is the base
- direction of the current paragraph, and is used to calculate the
+ string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi
+ embedding level of the current paragraph, and is used to calculate the
direction argument to pass to the font shaper.
If the character is composed, setup members of CMP_IT (id, nglyphs,
bool
composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w,
- bidi_dir_t pdir, struct face *face, Lisp_Object string)
+ signed char bidi_level, struct face *face, Lisp_Object string)
{
if (cmp_it->ch == -2)
{
continue;
if (charpos < endpos)
{
- if (pdir == L2R)
+ if ((bidi_level & 1) == 0)
direction = QL2R;
- else if (pdir == R2L)
+ else
direction = QR2L;
for (; CONSP (val); val = XCDR (val))
{
else
bpos = CHAR_TO_BYTE (cpos);
}
- if (pdir == L2R)
- direction = QR2L;
- else if (pdir == R2L)
+ if ((bidi_level & 1) == 0)
direction = QL2R;
+ else
+ direction = QR2L;
lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face,
string, direction);
if (! composition_gstring_p (lgstring)
Lisp_Object);
extern bool composition_reseat_it (struct composition_it *, ptrdiff_t,
ptrdiff_t, ptrdiff_t, struct window *,
- bidi_dir_t, struct face *, Lisp_Object);
+ signed char, struct face *, Lisp_Object);
extern int composition_update_it (struct composition_it *,
ptrdiff_t, ptrdiff_t, Lisp_Object);
|| ((IT)->cmp_it.stop_pos == (CHARPOS) \
&& composition_reseat_it (&(IT)->cmp_it, CHARPOS, BYTEPOS, \
END_CHARPOS, (IT)->w, \
- (IT)->bidi_it.paragraph_dir, \
+ (IT)->bidi_it.resolved_level, \
FACE_FROM_ID_OR_NULL ((IT)->f, \
(IT)->face_id), \
(IT)->string)))