unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Use fontconfig spec for parsing font-weight.
@ 2021-05-17  4:37 Yukio Siraichi
  2021-05-17  6:14 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Yukio Siraichi @ 2021-05-17  4:37 UTC (permalink / raw)
  To: emacs-devel

[-- 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <1b6ef436-2f32-bfed-f0a8-f55aa4852ccd@gmail.com>]

end of thread, other threads:[~2021-05-17 10:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17  4:37 [PATCH] Use fontconfig spec for parsing font-weight Yukio Siraichi
2021-05-17  6:14 ` 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

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).