unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Kenichi Handa <handa@gnu.org>
Cc: 11860@debbugs.gnu.org, smias@yandex.ru
Subject: bug#11860: 24.1; Arabic - Harakat (diacritics, short vowels) don't appear
Date: Sun, 09 Sep 2012 13:06:20 +0900	[thread overview]
Message-ID: <wlbohflu0z.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <wltxvzmrdv.wl%mituharu@math.s.chiba-u.ac.jp>

>>>>> On Sun, 19 Aug 2012 13:34:36 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

>>>>> On Sat, 18 Aug 2012 11:45:27 +0900, Kenichi Handa <handa@gnu.org> said:
>> 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.  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]

> The font backend driver on the Mac port is supposed to support
> right-to-left shaping (including for non-BMP chars, though I don't
> have a good example), and it gives the following result (diacritical
> mark comes first) for Courier New 13pt:

>   mac-ct:-*-Courier New-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1
> by these glyphs:
>   [0 1 1618 760 8 0 2 11 -8 [-1 2 1]]
>   [0 1 1593 969 8 0 6 5 4 [-1 0 8]]

The above result was not correct in a couple of points.  First, the
font backend driver for the Mac port had a bug (*1).  Second, OS X
10.7 and 10.8 seem to have a bug that they report incorrect lbearing
and rbearing values for Courier New (*2).  In particlar, the lbearing
value is always reported as 0, as in the above result.

*1: http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00157.html
*2: http://openradar.appspot.com/10377021

Mac OS X 10.6 does not have the second issue, and with the patch in
(*1), it reports the following result:

  mac-ct:-*-Courier New-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1
by these glyphs:
  [0 1 1618 760 8 3 5 11 -8 [-1 2 0]]
  [0 1 1593 969 8 1 8 5 4 nil]

> In the above example, the grapheme cluster consists of glyphs having
> non-nil adjustments (the last element of each vector).  In the
> function Ffont_shape_gstring, there is some code that merges grapheme
> clusters generated by a font backend driver so each of them starts
> with a glyph having non-nil adjustment (except the first grapheme
> cluster of the gstring).  I think this is not correct especially for
> right-to-left text, and I disabled that part in the Mac port.  Could
> you give an example if you think this part is necessary?

The first glyph in the above result still has non-nil adjustments.
Another example is the Arabic "u-S-u" case for Arial 30pt (*3).  It
consists of the following two grapheme clusters (from right to left):

  [0 1 1613 755 0 1 7 2 4 [0 0 -3]]
  [0 1 0 971 16 -1 15 15 -4 nil]

  [2 2 0 970 14 1 15 13 7 [0 0 16]]

*3: http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-09/msg00178.html

As you explained, the grapheme clusters are in logical order, and
glyphs in each grapheme cluster are in drawing order.  So simply
merging grapheme clusters as in the code in Ffont_shape_gstring does
not seem to be correct in the case of right-to-left text (what's drawn
later comes earlier in a merged grapheme cluster).

IMO, dividing glyphs into grapheme clusters is font backed driver's
task, and I don't understand why Ffont_shape_gstring merges the
grapheme clusters for some cases.  Could you explain?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





  reply	other threads:[~2012-09-09  4:06 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04  9:17 bug#11860: 24.1; Arabic - Harakat (diacritics, short vowels) don't appear Steffan
2012-07-04 20:22 ` Eli Zaretskii
2012-07-05 17:53 ` Steffan
2012-08-05  5:27 ` Steffan
2012-08-05 15:49   ` Eli Zaretskii
2012-08-13  0:02     ` Kenichi Handa
2012-08-18  2:45       ` Kenichi Handa
2012-08-18  7:14         ` Eli Zaretskii
2012-08-18  9:19           ` Kenichi Handa
2012-08-18 15:33             ` Eli Zaretskii
2012-08-19  7:32               ` YAMAMOTO Mitsuharu
2012-08-19 12:51                 ` Kenichi Handa
2012-08-19 13:20               ` Kenichi Handa
2012-08-19 18:44                 ` Eli Zaretskii
2012-08-19 18:53                   ` Werner LEMBERG
2012-08-20 17:24                   ` Eli Zaretskii
2012-08-19  3:02             ` Jason Rumney
2012-08-19 13:37               ` Kenichi Handa
2012-08-19 16:16                 ` Jason Rumney
2012-08-19 18:54                   ` Eli Zaretskii
2012-08-20 14:57                     ` Kenichi Handa
2012-08-20 17:16                       ` Eli Zaretskii
2012-08-21  9:20                         ` Kenichi Handa
2012-08-19 18:52                 ` Eli Zaretskii
2012-08-19 17:56               ` Eli Zaretskii
2012-08-19  4:34         ` YAMAMOTO Mitsuharu
2012-09-09  4:06           ` YAMAMOTO Mitsuharu [this message]
2012-09-11 14:49             ` Kenichi Handa
2012-09-11 17:48               ` Eli Zaretskii
2012-09-12 13:14                 ` Kenichi Handa
2012-09-12 16:34                   ` Eli Zaretskii
2012-09-13  6:07                     ` Kenichi Handa
2012-09-13 17:00                       ` Eli Zaretskii
2012-09-13 23:26                         ` Kenichi Handa
2012-09-16 12:03               ` Kenichi Handa
2012-09-16 12:41                 ` Eli Zaretskii
2012-09-16 15:43                   ` Stefan Monnier
2012-09-16 15:50                     ` Eli Zaretskii
2012-09-17 14:08                       ` Kenichi Handa
2012-09-17 16:58                         ` Stefan Monnier
2012-08-19 18:22         ` Eli Zaretskii
2012-08-21 13:16           ` Kenichi Handa
2012-08-21 17:32             ` Eli Zaretskii
2012-08-22  9:15               ` Kenichi Handa
2012-08-22 19:52 ` Steffan
2012-08-23  2:50   ` Eli Zaretskii
2012-08-22 21:40 ` Steffan
2012-08-23  2:49   ` Eli Zaretskii
2012-08-27 21:10 ` Steffan
2012-08-29  8:09   ` Kenichi Handa
2012-09-01 13:59     ` Eli Zaretskii
2012-09-03 13:55       ` Kenichi Handa
2012-09-03 15:53         ` Eli Zaretskii
2012-09-04  9:03           ` Kenichi Handa
2012-08-29  8:57 ` Steffan
2012-09-01 14:06   ` Eli Zaretskii
2012-09-03 15:31 ` Steffan
2012-09-03 16:28   ` Eli Zaretskii
2012-09-04 17:18   ` Eli Zaretskii
2012-09-03 16:24 ` Steffan
2012-09-03 17:49 ` Steffan
2012-09-06  2:09   ` YAMAMOTO Mitsuharu
2012-09-06  8:52 ` Steffan
2012-09-06  9:56   ` YAMAMOTO Mitsuharu
2012-09-06 10:47     ` Eli Zaretskii
2012-09-06 14:52 ` Steffan
2012-09-10 16:13 ` Steffan
2020-08-17 22:45 ` Stefan Kangas
2020-08-18  4:40   ` Eli Zaretskii
2020-08-18  9:47     ` Stefan Kangas
     [not found] <14231341502795@web11e.yandex.ru>
2012-07-05 17:16 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wlbohflu0z.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=11860@debbugs.gnu.org \
    --cc=handa@gnu.org \
    --cc=smias@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).