From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#11860: 24.1; Arabic - Harakat (diacritics, short vowels) don't appear Date: Sat, 18 Aug 2012 18:19:19 +0900 Message-ID: <87k3wwimlk.fsf@gnu.org> References: <349071341393469@web30d.yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345281608 6990 80.91.229.3 (18 Aug 2012 09:20:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Aug 2012 09:20:08 +0000 (UTC) Cc: 11860@debbugs.gnu.org, smias@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 18 11:20:08 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T2fCR-0001Gd-Vq for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Aug 2012 11:20:08 +0200 Original-Received: from localhost ([::1]:52104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2fCQ-000714-OK for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Aug 2012 05:20:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2fCO-00070A-AM for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 05:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2fCM-0003pN-44 for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 05:20:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2fCM-0003nd-10 for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 05:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T2fCM-0007eq-Kj for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 05:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Aug 2012 09:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11860 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11860-submit@debbugs.gnu.org id=B11860.134528158229401 (code B ref 11860); Sat, 18 Aug 2012 09:20:02 +0000 Original-Received: (at 11860) by debbugs.gnu.org; 18 Aug 2012 09:19:42 +0000 Original-Received: from localhost ([127.0.0.1]:36672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T2fC2-0007eA-BH for submit@debbugs.gnu.org; Sat, 18 Aug 2012 05:19:42 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:50139) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T2fC0-0007e3-2M for 11860@debbugs.gnu.org; Sat, 18 Aug 2012 05:19:41 -0400 Original-Received: from 126.229.accsnet.ne.jp ([202.220.229.126]:64426 helo=ubuntu) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1T2fBx-0007NR-9h; Sat, 18 Aug 2012 05:19:38 -0400 In-Reply-To: <83txw0aczg.fsf@gnu.org> (message from Eli Zaretskii on Sat, 18 Aug 2012 10:14:11 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63264 Archived-At: In article <83txw0aczg.fsf@gnu.org>, Eli Zaretskii writes: > > From: Kenichi Handa > > Cc: eliz@gnu.org, 11860@debbugs.gnu.org, smias@yandex.ru > > Date: Sat, 18 Aug 2012 11:45:27 +0900 > > > > So, apparently Emacs on Windows and GNU/Linux uses the > > different metrics of glyphs. As the shaper on GNU/Linux > > (m17n-lib library) works correctly for the same font, and > > the other applications on Windows have no problem, I suspect > > that the problem is in Emacs' interface with uniscribe > > (w32font.c or w32uniscribe.c). > > > > If this problem happens only for bidi scripts, one > > possibility is that Emacs's rendering engine (xdisp.c) > > expects glyphs in a glyph-string are rendered in that order > > from left to right, but the returned glyph-string on Windows > > should be rendered in reverse order. > If this is the case, how come we display the diacriticals correctly on > Windows in other cases, e.g. with Hebrew? For Hebrew too, on Windows, I see the same problem as what Steffan reported: In article <349641344144469@web8d.yandex.ru>, Steffan writes: >>> I choose "hebrew-full" as input-method. >>> >>> - After typing 'f' I get KAF >>> - then by typing d I get GIMMEL >>> - and after typing 'D' I get "the three point sign" (HEBREW POINT QUBUTS) not below the GIMMEL but the KAF! If you don't face with that problem, perhaps we are using the different font. C-u C-x = tells that "courier new" is used for hebrew too in my case. > > For instance, in the above case, we may have to render glyphs in > > this order (diacritical mark first): > > > > [0 1 1593 760 0 3 6 12 4 [1 -2 0]] > > [0 1 1593 969 8 1 8 12 4 nil] > Could you propose a patch to try this isea? I have no idea. :-( > > I think the further debugging must be done by those who > > knows uniscribe, w32font.c, and w32uniscribe.c. > Alas, I don't think we have such people on board, not with high enough > availability, anyway. If you could kindly suggest where to look, what > variables to display, etc., I could try doing that, and reporting the > results. I've just read the function uniscribe_shape in w32uniscribe.c. It seems that these are the key API for uniscribe: * ScriptItemize -- no idea what is this * ScriptShape -- perhaps for glyph substitution (GSUB features of opentype) * ScriptPlace -- perhaps for glyph positioning (GPOS features of opentype) So at first please check the documentation of ScriptShape and figure out how it works for bidi script; i.e. what order does it expect for input, and what order does it produce. Next please find the meaning of this code fragment: /* Detect clusters, for linking codes back to characters. */ if (attributes[j].fClusterStart) { while (from < nchars_in_run && clusters[from] < j) from++; if (from >= nchars_in_run) from = to = nchars_in_run - 1; else { int k; to = nchars_in_run - 1; for (k = from + 1; k < nchars_in_run; k++) { if (clusters[k] > j) { to = k - 1; break; } } } } The comment refer to "clusters". I don't know what it exactly means in uniscribe, but I guess it relates to grapheme cluster, and if so, this part seems to relates to the ordering of glyphs in this kind of grapheme clauster: [0 1 1593 969 8 1 8 12 4 nil] [0 1 1593 760 0 3 6 12 4 [1 -2 0]] --- Kenichi Handa handa@gnu.org