]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow turning HarfBuzz off at run time
authorKhaled Hosny <khaledhosny@eglug.org>
Tue, 5 Jun 2018 10:34:04 +0000 (12:34 +0200)
committerKhaled Hosny <khaledhosny@eglug.org>
Sun, 9 Dec 2018 22:08:50 +0000 (00:08 +0200)
Useful for comparing the shaping result with that of m17n.

src/ftfont.c

index eb7c5d10e1550d97f91fc48461802137b5d7971d..d98652f379cab9577dac484edf9c1f0ea38fc07f 100644 (file)
@@ -2784,14 +2784,19 @@ ftfont_shape (Lisp_Object lgstring)
   struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
   struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
 #ifdef HAVE_HARFBUZZ
-  return ftfont_shape_by_hb (lgstring, ftfont_info->ft_size->face,
-                            &ftfont_info->matrix);
-#else
-  OTF *otf = ftfont_get_otf (ftfont_info);
+  if (getenv ("EMACS_NO_HARFBUZZ") == NULL)
+    {
+      return ftfont_shape_by_hb (lgstring, ftfont_info->ft_size->face,
+                                &ftfont_info->matrix);
+    }
+  else
+#endif  /* HAVE_HARFBUZZ */
+    {
+      OTF *otf = ftfont_get_otf (ftfont_info);
 
-  return ftfont_shape_by_flt (lgstring, font, ftfont_info->ft_size->face, otf,
-                             &ftfont_info->matrix);
-#endif
+      return ftfont_shape_by_flt (lgstring, font, ftfont_info->ft_size->face,
+                                 otf, &ftfont_info->matrix);
+    }
 }
 
 #endif /* defined HAVE_M17N_FLT || defined HAVE_HARFBUZZ */