From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#35781: Discrepancies between xftfont.c and ftcrfont.c Date: Wed, 22 May 2019 18:24:33 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <878sv5ou9r.fsf@gmail.com> <87pnofze6n.fsf@gmail.com> <87v9y66x9q.fsf@gmail.com> <03f91c3a5f9c7d823e2d6d9c8dfc7b60.squirrel@weber.math.s.chiba-u.ac.jp> <87zhnfljeq.fsf@gmail.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Wed_May_22_18:24:31_2019-1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218797"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 35781@debbugs.gnu.org, Alex Gramiak To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 22 11:26:48 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTNWI-000ukL-9n for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 May 2019 11:26:46 +0200 Original-Received: from localhost ([127.0.0.1]:39129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTNWH-0002YA-4t for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 May 2019 05:26:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTNUi-0001P2-2l for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 05:25:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTNUc-0002fW-TX for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 05:25:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTNUc-0002f5-Kr for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 05:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hTNUc-0003DL-CO for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 05:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35781 X-GNU-PR-Package: emacs Original-Received: via spool by 35781-submit@debbugs.gnu.org id=B35781.155851707712321 (code B ref 35781); Wed, 22 May 2019 09:25:02 +0000 Original-Received: (at 35781) by debbugs.gnu.org; 22 May 2019 09:24:37 +0000 Original-Received: from localhost ([127.0.0.1]:41573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTNUD-0003Cf-DQ for submit@debbugs.gnu.org; Wed, 22 May 2019 05:24:37 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:54240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTNUA-0003CU-4M for 35781@debbugs.gnu.org; Wed, 22 May 2019 05:24:36 -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 24D00F08FA; Wed, 22 May 2019 18:24:33 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <87zhnfljeq.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:159639 Archived-At: --Multipart_Wed_May_22_18:24:31_2019-1 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: base64 T24gV2VkLCAyMiBNYXkgMjAxOSAwNDowMzoyNSArMDkwMCwNCkuopnZpbiBMZSBHb3VndWVjIHdy b3RlOg0KPiANCj4gbWl0dWhhcnVAbWF0aC5zLmNoaWJhLXUuYWMuanAgd3JpdGVzOg0KPiANCj4g PiBJIHRyaWVkIG1ha2luZyBmdGNyZm9udF9vcGVuIGxvb2sgbXVjaCBsaWtlIHhmdGZvbnRfb3Bl bi4NCj4gPiBDb3VsZCB5b3UgdHJ5IHRoZSBhdHRhY2hlZCBwYXRjaD8NCj4gDQo+IFRoYW5rIHlv dSBmb3IgdGhpcyBwYXRjaCENCj4gDQo+IEkgYXBwbGllZCBpdCBvbiB0b3Agb2YgY2IzNjdjOGUw ZCwgYW5kIEFGQUlDVCB0aGlzIGZpeGVzIHRoZSBpc3N1ZTogb24NCj4gYm90aCBzZXR1cHMgd2hl cmUgSSB1c2VkIHRvIHNlZSBhIGRpZmZlcmVuY2UgaW4gaGludCBzdHl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nV6eg0KYnJhbmNoIGluIDE1IGhvdXJzIG9yIHNvLg0KDQoJCQkJICAgICBZQU1B TU9UTyBNaXRzdWhhcnUNCgkJCQltaXR1aGFydUBtYXRoLnMuY2hpYmEtdS5hYy5qcA0K --Multipart_Wed_May_22_18:24:31_2019-1 Content-Type: application/octet-stream; type=patch; name="xft-like-ftcr.diff" Content-Disposition: attachment; filename="xft-like-ftcr.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9mdGNyZm9udC5jIGIvc3JjL2Z0Y3Jmb250LmMKaW5kZXggMmQ1YTc2 NjU1NzguLjk2ODZjZWMwZThjIDEwMDY0NAotLS0gYS9zcmMvZnRjcmZvbnQuYworKysgYi9zcmMv ZnRjcmZvbnQuYwpAQCAtNzksNyArNzksNiBAQCBmdGNyZm9udF9nbHlwaF9leHRlbnRzIChzdHJ1 Y3QgZm9udCAqZm9udCwKICAgICAgIGNhaXJvX2dseXBoX3QgY3JfZ2x5cGggPSB7LmluZGV4ID0g Z2x5cGh9OwogICAgICAgY2Fpcm9fdGV4dF9leHRlbnRzX3QgZXh0ZW50czsKIAotICAgICAgRlRf QWN0aXZhdGVfU2l6ZSAoZnRjcmZvbnRfaW5mby0+ZnRfc2l6ZV9kcmF3KTsKICAgICAgIGNhaXJv X3NjYWxlZF9mb250X2dseXBoX2V4dGVudHMgKGZ0Y3Jmb250X2luZm8tPmNyX3NjYWxlZF9mb250 LAogCQkJCSAgICAgICAmY3JfZ2x5cGgsIDEsICZleHRlbnRzKTsKICAgICAgIGNhY2hlLT5sYmVh cmluZyA9IGZsb29yIChleHRlbnRzLnhfYmVhcmluZyk7CkBAIC0xMTgsMTAzICsxMTcsMTU5IEBA IGZ0Y3Jmb250X21hdGNoIChzdHJ1Y3QgZnJhbWUgKmYsIExpc3BfT2JqZWN0IHNwZWMpCiBzdGF0 aWMgTGlzcF9PYmplY3QKIGZ0Y3Jmb250X29wZW4gKHN0cnVjdCBmcmFtZSAqZiwgTGlzcF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AxMDA7 CisgIGlmIChpIDwgMCkgaSA9IDA7CisgIEZjUGF0dGVybkFkZEludGVnZXIgKHBhdCwgRkNfU0xB TlQsIGkpOworICBGY1BhdHRlcm5BZGRJbnRlZ2VyIChwYXQsIEZDX1dJRFRILCBGT05UX1dJRFRI X05VTUVSSUMgKGVudGl0eSkpOworICBGY1BhdHRlcm5BZGREb3VibGUgKHBhdCwgRkNfUElYRUxf U0laRSwgcGl4ZWxfc2l6ZSk7CisgIHZhbCA9IEFSRUYgKGVudGl0eSwgRk9OVF9GQU1JTFlfSU5E RVgpOworICBpZiAoISBOSUxQICh2YWwpKQorICAgIEZjUGF0dGVybkFkZFN0cmluZyAocGF0LCBG Q19GQU1JTFksIChGY0NoYXI4ICopIFNEQVRBIChTWU1CT0xfTkFNRSAodmFsKSkpOworICB2YWwg PSBBUkVGIChlbnRpdHksIEZPTlRfRk9VTkRSWV9JTkRFWCk7CisgIGlmICghIE5JTFAgKHZhbCkp CisgICAgRmNQYXR0ZXJuQWRkU3RyaW5nIChwYXQsIEZDX0ZPVU5EUlksIChGY0NoYXI4ICopIFNE QVRBIChTWU1CT0xfTkFNRSAodmFsKSkpOworICB2YWwgPSBBUkVGIChlbnRpdHksIEZPTlRfU1BB Q0lOR19JTkRFWCk7CisgIGlmICghIE5JTFAgKHZhbCkpCisgICAgRmNQYXR0ZXJuQWRkSW50ZWdl ciAocGF0LCBGQ19TUEFDSU5HLCBYRklYTlVNICh2YWwpKTsKKyAgdmFsID0gQVJFRiAoZW50aXR5 LCBGT05UX0RQSV9JTkRFWCk7CisgIGlmICghIE5JTFAgKHZhbCkpCisgICAgeworICAgICAgZG91 YmxlIGRibCA9IFhGSVhOVU0gKHZhbCk7CisKKyAgICAgIEZjUGF0dGVybkFkZERvdWJsZSAocGF0 LCBGQ19EUEksIGRibCk7CisgICAgfQorICB2YWwgPSBBUkVGIChlbnRpdHksIEZPTlRfQVZHV0lE VEhfSU5ERVgpOworICBpZiAoRklYTlVNUCAodmFsKSA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