From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: mituharu@math.s.chiba-u.ac.jp Newsgroups: gmane.emacs.bugs Subject: bug#35781: Discrepancies between xftfont.c and ftcrfont.c Date: Tue, 21 May 2019 19:59:55 +0900 Message-ID: <03f91c3a5f9c7d823e2d6d9c8dfc7b60.squirrel@weber.math.s.chiba-u.ac.jp> References: <878sv5ou9r.fsf@gmail.com> <87pnofze6n.fsf@gmail.com> <87v9y66x9q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20190521195955_69969" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="201245"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.22-5.el6 Cc: 35781@debbugs.gnu.org, K?vin Le Gouguec To: "Alex Gramiak" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 21 13:03:10 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 1hT2Y1-000q4i-Pg for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 May 2019 13:03:10 +0200 Original-Received: from localhost ([127.0.0.1]:51429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT2Xt-0007ZS-VY for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 May 2019 07:03:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT2V2-0005Bs-Je for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 07:00:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT2V1-0001fD-Li for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 07:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hT2V1-0001ei-Ei for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 07:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hT2V1-0001N3-94 for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 07:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: mituharu@math.s.chiba-u.ac.jp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 May 2019 11:00:03 +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.15584364015236 (code B ref 35781); Tue, 21 May 2019 11:00:03 +0000 Original-Received: (at 35781) by debbugs.gnu.org; 21 May 2019 11:00:01 +0000 Original-Received: from localhost ([127.0.0.1]:38733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT2Uz-0001MO-HG for submit@debbugs.gnu.org; Tue, 21 May 2019 07:00:01 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:55498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT2Uw-0001MC-48 for 35781@debbugs.gnu.org; Tue, 21 May 2019 06:59:59 -0400 Original-Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id C5A57F08F1; Tue, 21 May 2019 19:59:55 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Original-Received: from 220.221.159.39 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Tue, 21 May 2019 19:59:55 +0900 In-Reply-To: <87v9y66x9q.fsf@gmail.com> X-Priority: 3 (Normal) Importance: Normal 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:159608 Archived-At: ------=_20190521195955_69969 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8bit > Perhaps ftcrfont.c could use FcPatternAddFTFace, FcFontMatch, > cairo_ft_font_face_create_for_pattern, and otherwise the same pattern > building as xftfont.c. I tried making ftcrfont_open look much like xftfont_open. Could you try the attached patch? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp ------=_20190521195955_69969 Content-Type: application/octet-stream; name="xft-like-ftcr.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="xft-like-ftcr.diff" ZGlmZiAtLWdpdCBhL3NyYy9mdGNyZm9udC5jIGIvc3JjL2Z0Y3Jmb250LmMKaW5kZXggMmQ1YTc2 NjU1NzguLjdhMDg5NjE4NDdjIDEwMDY0NAotLS0gYS9zcmMvZnRjcmZvbnQuYworKysgYi9zcmMv ZnRjcmZvbnQuYwpAQCAtNzksNyArNzksNiBAQCBmdGNyZm9udF9nbHlwaF9leHRlbnRzIChzdHJ1 Y3QgZm9udCAqZm9udCwKICAgICAgIGNhaXJvX2dseXBoX3QgY3JfZ2x5cGggPSB7LmluZGV4ID0g Z2x5cGh9OwogICAgICAgY2Fpcm9fdGV4dF9leHRlbnRzX3QgZXh0ZW50czsKIAotICAgICAgRlRf QWN0aXZhdGV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pdHksIEZPTlRfRVhUUkFfSU5E RVgpKTsKLQkgIGlmICghKENPTlNQICh2YWwpICYmIE5JTFAgKFhDRFIgKHZhbCkpKSkKKwkgIGlm IChnbHlwaHMgIT0gJnN0YWNrX2dseXBoKQorCSAgICBjYWlyb19nbHlwaF9mcmVlIChnbHlwaHMp OworCSAgZWxzZSBpZiAoc3RhY2tfZ2x5cGguaW5kZXgpCiAJICAgIHsKLQkgICAgICBmb250LT5k ZXNjZW50ID0gbHJvdW5kIChleHRlbnRzLmRlc2NlbnQpOwotCSAgICAgIGZvbnQtPmhlaWdodCA9 IGZvbnQtPmFzY2VudCArIGZvbnQtPmRlc2NlbnQ7Ci0JICAgIH0KLQkgIGVsc2UKLQkgICAgewot CSAgICAgIGZvbnQtPmhlaWdodCA9IGxyb3VuZCAoZXh0ZW50cy5oZWlnaHQpOwotCSAgICAgIGZv bnQtPmRlc2NlbnQgPSBmb250LT5oZWlnaHQgLSBmb250LT5hc2NlbnQ7CisJICAgICAgaW50IHRo aXNfd2lkdGggPSBmdGNyZm9udF9nbHlwaF9leHRlbnRzIChmb250LCBzdGFja19nbHlwaC5pbmRl eCwKKwkJCQkJCSAgICAgICBOVUxMKTsKKworCSAgICAgIGlmICh0aGlzX3dpZHRoID4gMAorCQkg ICYmICghIGZvbnQtPm1pbl93aWR0aAorCQkgICAgICB8fCBmb250LT5taW5fd2lkdGggPiB0aGlz X3dpZHRoKSkKKwkJZm9udC0+bWluX3dpZHRoID0gdGhpc193aWR0aDsKKwkgICAgICBpZiAoYyA9 PSAzMikKKwkJZm9udC0+c3BhY2Vfd2lkdGggPSB0aGlzX3dpZHRoOworCSAgICAgIGZvbnQtPmF2 ZXJhZ2Vfd2lkdGggKz0gdGhpc193aWR0aDsKKwkgICAgICBuKys7CiAJICAgIH0KKwl9CisgICAg fQorICBpZiAobiA+IDApCisgICAgZm9udC0+YXZlcmFnZV93aWR0aCAvPSBuOwogCi0JICBjYWly b19nbHlwaF90IHN0YWNrX2dseXBoO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bvc2l0aW9uICogc2l6ZSAvIHVwRU07CisgICAgICBmb250LT51bmRl cmxpbmVfdGhpY2tuZXNzID0gZnRfZmFjZS0+dW5kZXJsaW5lX3RoaWNrbmVzcyAqIHNpemUgLyB1 cEVNOworICAgICAgaWYgKGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAyKQorCWZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbiAtPSBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzIC8gMjsKKyAgICB9 CisgIGVsc2UKKyAgICB7CisgICAgICBmb250LT51bmRlcmxpbmVfcG9zaXRpb24gPSAtMTsKKyAg ICAgIGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPSAwOwogICAgIH0KKyNpZmRlZiBIQVZFX0xJ Qk9URgorICBmdGNyZm9udF9pbmZvLT5tYXliZV9vdGYgPSAoZnRfZmFjZS0+ZmFjZV9mbGFncyAm IEZUX0ZBQ0VfRkxBR19TRk5UKSAhPSAwOworICBmdGNyZm9udF9pbmZvLT5vdGYgPSBOVUxMOwor I2VuZGlmCS8qIEhBVkVfTElCT1RGICovCisgIGNhaXJvX2Z0X3NjYWxlZF9mb250X3VubG9ja19m YWNlIChzY2FsZWRfZm9udCk7CisgIGZ0Y3Jmb250X2luZm8tPmZ0X3NpemUgPSBOVUxMOwogICB1 bmJsb2NrX2lucHV0ICgpOwogCisgIGZvbnQtPmJhc2VsaW5lX29mZnNldCA9IDA7CisgIGZvbnQt PnJlbGF0aXZlX2NvbXBvc2UgPSAwOworICBmb250LT5kZWZhdWx0X2FzY2VudCA9IDA7CisgIGZv bnQtPnZlcnRpY2FsX2NlbnRlcmluZyA9IGZhbHNlOworCiAgIHJldHVybiBmb250X29iamVjdDsK IH0KIApAQCAtMjI1LDE5ICsyNzUsNTggQEAgZnRjcmZvbnRfY2xvc2UgKHN0cnVjdCBmb250ICpm b250KQogICAgIHJldHVybjsKIAogICBzdHJ1Y3QgZm9udF9pbmZvICpmdGNyZm9udF9pbmZvID0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