From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#50951: 28.0.50; Urdu text is not displayed correctly Date: Tue, 20 Sep 2022 12:41:40 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83mtnsc63i.fsf@gnu.org> <83sfxjbox7.fsf@gnu.org> <87pmsnwlvo.fsf@igel.home> <837devbgrl.fsf@gnu.org> <8335pjbewj.fsf@gnu.org> <83zgrr9zn1.fsf@gnu.org> <87edwq7srx.fsf_-_@gnus.org> <87y1uy6mn5.fsf@zohomail.eu> <83wnaij974.fsf@gnu.org> <87tu5m6jrw.fsf@zohomail.eu> <835yhzifuw.fsf@gnu.org> <87o7vqxuvs.fsf@gmail.com> <87h71gwpr5.fsf@zohomail.eu> <87mtayymk5.fsf@zohomail.eu> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Tue_Sep_20_12:41:40_2022-1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29604"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 50951@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org, Visuwesh To: Rah Guzar Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 20 05:42:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaU9Q-0007VM-Tl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Sep 2022 05:42:25 +0200 Original-Received: from localhost ([::1]:46694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaU9P-0003Tt-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 23:42:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaU96-0003Th-Fp for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 23:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaU94-0007da-3B for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 23:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaU93-0006fx-IW for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 23:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Sep 2022 03:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 50951-submit@debbugs.gnu.org id=B50951.166364530525638 (code B ref 50951); Tue, 20 Sep 2022 03:42:01 +0000 Original-Received: (at 50951) by debbugs.gnu.org; 20 Sep 2022 03:41:45 +0000 Original-Received: from localhost ([127.0.0.1]:55741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaU8n-0006fR-2A for submit@debbugs.gnu.org; Mon, 19 Sep 2022 23:41:45 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:62672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaU8k-0006fI-4N for 50951@debbugs.gnu.org; Mon, 19 Sep 2022 23:41:42 -0400 Original-Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 46802F08ED; Tue, 20 Sep 2022 12:41:40 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <87mtayymk5.fsf@zohomail.eu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243143 Archived-At: --Multipart_Tue_Sep_20_12:41:40_2022-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, 18 Sep 2022 01:37:39 +0900, Rah Guzar wrote: >=20 >=20 > I finally tested the patches and both of them improve the situation by a > lot but problems still remain. One word that is not rendered by > accurately by them is >=20 > =DB=81=D9=86=DA=AF=D8=A7=D9=85 >=20 > Where is problem is fourth character which is > character: =DA=AF=E2=80=8E (displayed as =DA=AF=E2=80=8E) (codepo= int 1711, #o3257, #x6af) > charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U= +FFFF)) > code point in charset: 0x06AF > script: arabic >=20 > This character should be rendered as a circle and two slanted lines > which seem to get clipped. Thanks for testing. The width of grapheme cluster corresponding to U+06AF (ARABIC LETTER GAF) is rounded to zero, and Emacs does not display such clusters: xdisp.c: 32424 gstring =3D composition_gstring_from_id (it->cmp_it.id); 32425 it->pixel_width 32426 =3D composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it= .to, 32427 &metrics); 32428 if (it->pixel_width =3D=3D 0) 32429 { 32430 it->glyph_not_available_p =3D true; 32431 it->phys_ascent =3D it->ascent; 32432 it->phys_descent =3D it->descent; 32433 it->pixel_width =3D face->font->space_width; 32434 } 32435 else The attached patch avoids zero-width grapheme clusters by adding 1 to the width of the last glyph in such clusters. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp --Multipart_Tue_Sep_20_12:41:40_2022-1 Content-Type: application/octet-stream; type=patch; name="avoid-zero-width-grapheme-clusters.diff" Content-Disposition: attachment; filename="avoid-zero-width-grapheme-clusters.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9jb21wb3NpdGUuYyBiL3NyYy9jb21wb3NpdGUuYwppbmRleCAyNDlk NzU4N2Y2Li41ZTg1NmZkNWU1IDEwMDY0NAotLS0gYS9zcmMvY29tcG9zaXRlLmMKKysrIGIvc3Jj L2NvbXBvc2l0ZS5jCkBAIC04MDAsNiArODAwLDQ4IEBAIGNvbXBvc2l0aW9uX2dzdHJpbmdfd2lk dGggKExpc3BfT2JqZWN0IGdzdHJpbmcsIHB0cmRpZmZfdCBmcm9tLCBwdHJkaWZmX3QgdG8sCiAg IHJldHVybiB3aWR0aDsKIH0KIAorLyogQWRqdXN0IHRoZSB3aWR0aCBvZiBlYWNoIGdyYXBoZW1l IGNsdXN0ZXIgb2YgR1NUUklORyBiZWNhdXNlCisgICB6ZXJvLXdpZHRoIGdyYXBoZW1lIGNsdXN0 ZXJzIGFyZSBub3QgZGlzcGxheWVkLiAgSWYgdGhlIHdpZHRoIGlzCisgICB6ZXJvLCB0aGVuIHRo ZSB3aWR0aCBvZiB0aGUgbGFzdCBnbHlwaCBpbiB0aGUgY2x1c3RlciBpcworICAgaW5jcmVtZW50 ZWQuICAqLworCit2b2lkCitjb21wb3NpdGlvbl9nc3RyaW5nX2FkanVzdF96ZXJvX3dpZHRoIChM aXNwX09iamVjdCBnc3RyaW5nKQoreworICBwdHJkaWZmX3QgZnJvbSA9IDA7CisgIGludCB3aWR0 aCA9IDA7CisKKyAgZm9yIChwdHJkaWZmX3QgaSA9IDA7IGkgPCBMR1NUUklOR19HTFlQSF9MRU4g KGdzdHJpbmcpOyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZ2x5cGggPSBMR1NUUklO R19HTFlQSCAoZ3N0cmluZywgaSk7CisKKyAgICAgIGlmIChOSUxQIChnbHlwaCkgfHwgZnJvbSAh PSBMR0xZUEhfRlJPTSAoZ2x5cGgpKQorCXsKKwkgIGVhc3NlcnQgKGkgPiAwKTsKKwkgIExpc3Bf T2JqZWN0IGxhc3QgPSBMR1NUUklOR19HTFlQSCAoZ3N0cmluZywgaSAtIDEpOworCisJICBpZiAo d2lkdGggPT0gMCkKKwkgICAgeworCSAgICAgIGlmIChOSUxQIChMR0xZUEhfQURKVVNUTUVOVCAo bGFzdCkpKQorCQlMR0xZUEhfU0VUX0FESlVTVE1FTlQgKGxhc3QsCisJCQkJICAgICAgIENBTExO IChGdmVjdG9yLAorCQkJCQkgICAgICBtYWtlX2ZpeG51bSAoMCksIG1ha2VfZml4bnVtICgwKSwK KwkJCQkJICAgICAgbWFrZV9maXhudW0gKExHTFlQSF9XSURUSCAobGFzdCkKKwkJCQkJCQkgICAr IDEpKSk7CisJICAgICAgZWxzZQorCQlBU0VUIChMR0xZUEhfQURKVVNUTUVOVCAobGFzdCksIDIs CisJCSAgICAgIG1ha2VfZml4bnVtIChMR0xZUEhfV0FESlVTVCAobGFzdCkgKyAxKSk7CisJICAg IH0KKwkgIGlmIChOSUxQIChnbHlwaCkpCisJICAgIGJyZWFrOworCSAgZnJvbSA9IExHTFlQSF9G Uk9NIChnbHlwaCk7CisJICB3aWR0aCA9IDA7CisJfQorICAgICAgd2lkdGggKz0gKE5JTFAgKExH TFlQSF9BREpVU1RNRU5UIChnbHlwaCkpCisJCT8g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