From: Yukio Siraichi <sir.yukio@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] Use fontconfig spec for parsing font-weight.
Date: Mon, 17 May 2021 13:37:31 +0900 [thread overview]
Message-ID: <c5c809db-d09c-11c6-a46e-a3ec32a8d714@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 781 bytes --]
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
[-- Attachment #2: 0001-Use-fontconfig-spec-for-parsing-font-weight.patch --]
[-- Type: text/x-patch, Size: 857 bytes --]
From 966241a4f215c8157830405859fbae5da7a68518 Mon Sep 17 00:00:00 2001
From: Yukio Siraichi <yukio.siraichi@gmail.com>
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
next reply other threads:[~2021-05-17 4:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 4:37 Yukio Siraichi [this message]
2021-05-17 6:14 ` [PATCH] Use fontconfig spec for parsing font-weight Eli Zaretskii
[not found] ` <75349245-3caa-ea30-939d-0a2b8bc32aa5@gmail.com>
2021-05-17 7:30 ` Eli Zaretskii
2021-05-17 7:44 ` Eli Zaretskii
[not found] <1b6ef436-2f32-bfed-f0a8-f55aa4852ccd@gmail.com>
2021-05-17 9:54 ` Eli Zaretskii
2021-05-17 10:11 ` Yukio Siraichi
2021-05-17 10:29 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5c809db-d09c-11c6-a46e-a3ec32a8d714@gmail.com \
--to=sir.yukio@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).