Subject: Re: bug#21846: 25.0.50; emacs hebrew script bidi nikud rendering bug

From: handa <[email-masked]>
Date: Mon, 21 Mar 2016 23:56:49 +0900

In article <[email-masked]>, Wolfgang Jenkner <[email-masked]> writes:

> These changes (536f48e, 9835757, resp. the backports to emacs-25, viz.
> 4a3db0f, ad879b7) seem to break rendering of some Indic scripts.
> Conjuncts are not composed anymore but rendered with virāma instead.
> E.g., please see the Hindi entry of the HELLO file.

> Apparently, the reason is this change

> -      if (0x300 <= c1 && c1 <= 0x36F)
> +      if (CHAR_HAS_CATEGORY (c1, '^'))

> as, say, "DEVANAGARI SIGN VIRAMA" is excluded by the old condition but
> included by the new one:

Oops, right.  Have about this change?

---
K. Handa
[email-masked]

2016-03-21  handa  <[email-masked]>

	* ftfont.c (ftfont_shape_by_flt): For combining characters out
	of the range U+300...U+36F, use the "combining" FLT only with
	non-OTF fonts.

diff --git a/src/ftfont.c b/src/ftfont.c
index 505d508..17ccda4 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -2596,7 +2596,12 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
 	 language information, and select a proper flt for them
 	 here.  */
       int c1 = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 1));
-      if (CHAR_HAS_CATEGORY (c1, '^'))
+      /* For the combining characters in the range U+300..U+36F,
+	 "combining" is the sole FLT provided by the m17n-lib.  In
+	 addition, it is the sole FLT that can handle the other
+	 combining characters with non-OTF fonts.  */
+      if (0x300 <= c1 && c1 <= 0x36F
+	  || (! otf  && CHAR_HAS_CATEGORY (c1, '^')))
 	flt = mflt_get (msymbol ("combining"));
     }
   if (! flt && ! otf)