]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Arabic shaping when eww/shr fill the text to be rendered
authorEli Zaretskii <eliz@gnu.org>
Fri, 5 Jun 2020 07:56:01 +0000 (10:56 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 5 Jun 2020 07:56:01 +0000 (10:56 +0300)
* src/hbfont.c (hbfont_shape): Don't use DIRECTION if the current
buffer has bidi reordering disabled.  (Bug#41005)

src/hbfont.c

index 576c5fe7f60577710b7fbbdf69eac3eea33022c8..4b3f64ef504a604bbe03c21a6435cee7697c3f02 100644 (file)
@@ -26,6 +26,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "composite.h"
 #include "font.h"
 #include "dispextern.h"
+#include "buffer.h"
 
 #ifdef HAVE_NTGUI
 
@@ -438,7 +439,11 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
 
   /* 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))