From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kai Ma Newsgroups: gmane.emacs.bugs Subject: bug#55319: 28.1.50; Abugida not rendered correctly (MacOS) Date: Thu, 12 May 2022 16:26:49 +0800 Message-ID: <56617540-B9BC-4769-BE87-24935CBAA99C@gmail.com> References: <83ilqgufm3.fsf@gnu.org> <83czgnv3ak.fsf@gnu.org> <052FC289-9179-4B2D-AE52-2D688410162C@gmail.com> <87zgjn41db.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2254"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 55319@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 12 17:01:17 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 1npAJZ-0000NX-GU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 17:01:17 +0200 Original-Received: from localhost ([::1]:41022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npAJY-0006Xx-H7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 11:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npAJK-0006Xm-PE for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 11:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npAJJ-0006Jv-VZ for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 11:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npAJJ-0005VQ-Qv for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 11:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kai Ma Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2022 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55319 X-GNU-PR-Package: emacs Original-Received: via spool by 55319-submit@debbugs.gnu.org id=B55319.165236765021135 (code B ref 55319); Thu, 12 May 2022 15:01:01 +0000 Original-Received: (at 55319) by debbugs.gnu.org; 12 May 2022 15:00:50 +0000 Original-Received: from localhost ([127.0.0.1]:41957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npAJ8-0005Uo-CC for submit@debbugs.gnu.org; Thu, 12 May 2022 11:00:50 -0400 Original-Received: from mail-pg1-f196.google.com ([209.85.215.196]:36367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1np49z-00061F-Qe for 55319@debbugs.gnu.org; Thu, 12 May 2022 04:27:00 -0400 Original-Received: by mail-pg1-f196.google.com with SMTP id h186so1317398pgc.3 for <55319@debbugs.gnu.org>; Thu, 12 May 2022 01:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sQxskBAf6CZGu4pkIqzoNAHDem3bU/YtfODVtxuDk0E=; b=bDkrFSgXhEm7Hix1BaODtvoUwnIh8k9cQorMOn7/2BYGX7DvRmV5YxKG4hzgfKScsa /tCVQBfAY2k+wsi80tVqkDgrDXvu/9R0whFPB0VgyjaJgHIcpWu/cApXDY11fpkhqX3K w6ot2oypKEh/dJ1RHislqdvWJqLeP8groFqPFdCQAoHhlZpP5K2SkCgjR8RTtUekE9Z+ BCsqASrpOjgz9T+VG1A5UdlH3Y24ygGyYDIiYXZvjQHtI7AbfAZYZLKzqqNuoutYc2Qf DRZUJDNpo4+IE8V4RZbus8pQRxstyWw/we8mUJkmBhm1iC094bbSBd+aVXxZ/zd5Kkw4 HHeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sQxskBAf6CZGu4pkIqzoNAHDem3bU/YtfODVtxuDk0E=; b=clagI0RR9tOLhgfW9OB1YK+EKp6+F9F2jvuqBpJ+1ceD+o/MoGkl4HmEYrrzrW3qgp eTl4JIHTavpePosoScZhrRDaJjC8FMLLg1GzIzP9yie7onvENFIpIjDaFp16AB1xuUs3 rWNVziA5Q3zTNu3f0UOAT4trHJUmkOHG0n7Z5x05vwntisHbqQKKoZ2jbF3xsdKDeDPl YD2m4eVba67jfwkfvh4PTpfmlT/x64x8tC5WnGX12gCXERNBvQP4VL1ya5UVtAp4FQX+ I16yN1LnAk3uNxlvKvxFdt0XqRdif/4Y4e0CLu3BxhkpvB8YDJDwk3mEtn7VLWF/58G1 uY0Q== X-Gm-Message-State: AOAM532N3bvZCuV2uKjE5l4e6kGtl24WknIcGluOJMWrOtMs8JGpsKqA VXih544lp0WuIp/NwOyg0Bs= X-Google-Smtp-Source: ABdhPJzWy0RVUjYfZfrjD7ouuzK9xDbG3p6tiRJjrb2P5O/0DPQ2iEx0rAyvrbmk2QymhJZtvwcyVw== X-Received: by 2002:a63:6381:0:b0:3c6:4449:fc60 with SMTP id x123-20020a636381000000b003c64449fc60mr23491167pgb.457.1652344013994; Thu, 12 May 2022 01:26:53 -0700 (PDT) Original-Received: from smtpclient.apple ([134.209.106.31]) by smtp.gmail.com with ESMTPSA id e186-20020a621ec3000000b0050dc7628171sm3120115pfe.75.2022.05.12.01.26.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2022 01:26:53 -0700 (PDT) In-Reply-To: <87zgjn41db.fsf@gmail.com> X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Mailman-Approved-At: Thu, 12 May 2022 11:00:49 -0400 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:232053 Archived-At: > On May 12, 2022, at 16:10, Robert Pluim wrote: >=20 >>>>>> On Wed, 11 May 2022 23:43:36 +0800, Kai Ma = said: >=20 >>> On May 9, 2022, at 10:38, Eli Zaretskii > wrote: >>>=20 >>> Emacs doesn't discover composition rules. The composition rules are >>> part of the Emacs code, see the various *.el files in lisp/language/ >>> directory. Some of these composition rules are derived automatically >>> from character properties, see composite.el and characters.el (which >>> cannot happen without Emacs knowing up-front about the properties). >=20 > Kai> Thanks for this. I didn=E2=80=99t know Emacs needed to = manually compose characters. >=20 > Kai> Feel free to close this report, since it is due to my = misunderstanding, not a real problem nor a real =E2=80=9Cwishlist=E2=80=9D= . >=20 > Kai> BTW, >=20 > Kai> I did try to follow language/*.el, and come with up the = following code: >=20 > Kai> (let* ((c "[\uED80-\uED9F]\\|\uEDAA\\|\uEDAB=E2=80=9D) ; = constant >=20 > ie: "[\uED80-\uED9F\uEDAA\uEDAB]=E2=80=9D >=20 > Kai> (v "[\uEDA0-\uEDA9]=E2=80=9D) ; vowel > Kai> (cv (concat v c))) >=20 > You've called this 'cv', but it=CA=BCs actually 'vc'. >=20 > Kai> (set-char-table-range > Kai> composition-function-table '(#xeda0 . #xeda9) > Kai> (list=20 > Kai> (vector cv 1 #'zbalermorna-shape-gstring) > Kai> [nil 0 font-shape-gstring]))) >=20 > You=CA=BCre looking back from vowels, it might be easier to add = entries for > the consonants and look forward. >=20 > Kai> (defun zbalermorna-shape-gstring (gstring direction) > Kai> (message "shape %s" gstring) ; debugging > Kai> gstring) >=20 > Kai> But it doesn=E2=80=99t work as expected. For example, =E2=80=9Ck= a=E2=80=9D should be > Kai> composed, but the behavior here is =E2=80=9Ca=E2=80=9D itself = is composed, > Kai> and when the first rule is matched, only the consonant =E2=80=9C= k=E2=80=9D is > Kai> sent to font-shape-gstring: only =E2=80=9Ck=E2=80=9D is in the = header. >=20 > Kai> Have you any pointers? Thanks! >=20 > I think if you fix 'cv' this will work. Thanks. I=E2=80=99ve got it work. Besides the pattern problem, there were two missing pieces: (1) canonical-combining-class, and=20 (2) `compose-' to actually compose it into one glyph. = `font-shape-gstring' alone does not work. This is the result: (defun zbalermorna-setup () "Set up the composition rules for zbalermonrna." (interactive) (dolist (v (number-sequence #xeda0 #xeda9)) (put-char-code-property v 'canonical-combining-class = (encode-composition-rule '(tc . bc)))) (let* ((c "\\([\uED80-\uED97]\\|\uEDAA\\|\uEDAB\\)") (v "[\uEDA0-\uEDA9]") (dot "\uED89") (h "\uED8A") (pattern1 (concat c v)) (pattern2 (concat v h v))) (set-char-table-range composition-function-table '(#xeda0 . #xeda9) (list (vector pattern2 2 #'compose-gstring-for-graphic) (vector pattern1 1 #'compose-gstring-for-graphic) [nil 0 font-shape-gstring]))))