From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yukio Siraichi Newsgroups: gmane.emacs.devel Subject: [PATCH] Use fontconfig spec for parsing font-weight. Date: Mon, 17 May 2021 13:37:31 +0900 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B3A0DC96C2BC49A4401A956A" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31253"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 17 07:08:51 2021 Return-path: Envelope-to: ged-emacs-devel@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 1liVUp-0007yo-Md for ged-emacs-devel@m.gmane-mx.org; Mon, 17 May 2021 07:08:51 +0200 Original-Received: from localhost ([::1]:36364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liVUo-0006aA-NJ for ged-emacs-devel@m.gmane-mx.org; Mon, 17 May 2021 01:08:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liV0c-0000gk-7T for emacs-devel@gnu.org; Mon, 17 May 2021 00:37:38 -0400 Original-Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:37384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liV0a-0003Wm-B4 for emacs-devel@gnu.org; Mon, 17 May 2021 00:37:37 -0400 Original-Received: by mail-pg1-x52a.google.com with SMTP id t193so3802492pgb.4 for ; Sun, 16 May 2021 21:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=60S+6Pc59FjT0gSgNroN6T7QCux7Ti7ifc5q2PvgZbg=; b=olqLACLuhWIy0et1Yw9jy/hBuD18Oifw64uF69t+O56dtxJpL+NVfhHJyfeTqVoNtc BZqdG6gccnWlULl/U21kPf3xIghvpi4qIItUawXOJM9BorSiiyseFkl4La/UUBT5lRY6 GIhp4w6EFXreg05vYWdRgK+BlceDDuA8SMtjlsqZ7dIqLFc6hzMnbL1T+13MSog4NJt9 hiExDXndHA002FgjvYNfgPijpptNfNng61gi0uficE7zuYAohcFAbqn2J/1YWYX5oyYt gzfSRawXEHcVLqznAD4a5bfTy4VMAGp2MsOuk/B8Ot+ziCiuwFa8rBSscAI39NzGrTo+ Iyaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=60S+6Pc59FjT0gSgNroN6T7QCux7Ti7ifc5q2PvgZbg=; b=qSI4aeKBuZxYouYCFJiFIvPasc+UppVee5lH82Y3Rlx0OPPM5F/q8S4XJCPc5JH9Dz LwSDvi0w8ir4XHFl9usCuN3Mbcm2Z8gU1UdY9bWATDFc2jxXQE68UFOaQof6qPu1ZG4f 0Fs8fT9rjlki1va4B5mgl0VoQrBPQlGPm0vDnZuKgvM0WAa0a/gAJgnYOsChXIZjJ+q/ Mhzt+fky2YNI/DtyHVLlUQY6arhoLMqDvafRIh9/Ig8i7czHh3r9ZhtRZW/csMSpJxTV WLnDOt6qXly9pofFFUJnG9kXUjvpGwnbf2GZYq4HNDI655bHi8bVh77gXOTKpd2ko12g RRMQ== X-Gm-Message-State: AOAM533Np7WNkOTJT0b6fkaruEkQ1EhtAEcawVQn8XaFGTaJlXHmBH1l s2EQtpsxPFofJRL3UZ1rbtbMCvdWgfoWIQ== X-Google-Smtp-Source: ABdhPJzm+kDwG+MMfXin2RQsMtT3K9TgMywqHAfT8PGaSirBLMvgm4bYRoLU2WQdZWdyiw3zlx365Q== X-Received: by 2002:a63:591b:: with SMTP id n27mr59431111pgb.33.1621226254051; Sun, 16 May 2021 21:37:34 -0700 (PDT) Original-Received: from [192.168.11.15] (FLH1Afk096.stm.mesh.ad.jp. [125.196.174.96]) by smtp.gmail.com with ESMTPSA id nh10sm9308162pjb.49.2021.05.16.21.37.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 May 2021 21:37:33 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=sir.yukio@gmail.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 17 May 2021 01:08:10 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269385 Archived-At: This is a multi-part message in MIME format. --------------B3A0DC96C2BC49A4401A956A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi. This patch addresses one of the differences between 'fontconfig' font-weight table, and the one inside emacs. Basically, the problem was that emacs wasn't listing fonts whose weight=55. However, those are defined to be 'semilight' in the fontconfig specification (see link below). Reproducing this problem only requires the existence of fonts whose weight=55 (one can use fc-cat for that). It's possible to observe that such fonts are not found in 'x-list-fonts' or when running 'describe-font'. https://www.freedesktop.org/software/fontconfig/fontconfig-user.html I don't fully understand how emacs is using the 'weight_table' (in font.c), so my explanation may not be fully correct, but this patch does make (fontconfig) semilight fonts show up. Regards, Yukio --------------B3A0DC96C2BC49A4401A956A Content-Type: text/x-patch; charset=UTF-8; name="0001-Use-fontconfig-spec-for-parsing-font-weight.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Use-fontconfig-spec-for-parsing-font-weight.patch" >From 966241a4f215c8157830405859fbae5da7a68518 Mon Sep 17 00:00:00 2001 From: Yukio Siraichi Date: Mon, 17 May 2021 13:20:11 +0900 Subject: [PATCH] Use fontconfig spec for parsing font-weight. --- src/font.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/font.c b/src/font.c index 7c1d1ff89b..b420bb14a7 100644 --- a/src/font.c +++ b/src/font.c @@ -69,7 +69,8 @@ #define DEFAULT_ENCODING Qiso8859_1 { 20, { "ultra-light", "ultralight" }}, { 40, { "extra-light", "extralight" }}, { 50, { "light" }}, - { 75, { "semi-light", "semilight", "demilight", "book" }}, + { 55, { "semi-light", "semilight", "demilight" }}, + { 75, { "book" }}, { 100, { "normal", "medium", "regular", "unspecified" }}, { 180, { "semi-bold", "semibold", "demibold", "demi" }}, { 200, { "bold" }}, -- 2.31.1 --------------B3A0DC96C2BC49A4401A956A--