* src/hbfont.c (hbfont_shape): Don't use DIRECTION if the current
buffer has bidi reordering disabled. (Bug#41005)
#include "composite.h"
#include "font.h"
#include "dispextern.h"
+#include "buffer.h"
#ifdef HAVE_NTGUI
/* If the caller didn't provide a meaningful DIRECTION, let HarfBuzz
guess it. */
- if (!NILP (direction))
+ if (!NILP (direction)
+ /* If they bind bidi-display-reordering to nil, the DIRECTION
+ they provide is meaningless, and we should let HarfBuzz guess
+ the real direction. */
+ && !NILP (BVAR (current_buffer, bidi_display_reordering)))
{
hb_direction_t dir = HB_DIRECTION_LTR;
if (EQ (direction, QL2R))