[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Font selection depending on the face weight
From: |
Robert Pluim |
Subject: |
Re: Font selection depending on the face weight |
Date: |
Mon, 22 May 2023 15:00:24 +0200 |
>>>>> On Mon, 22 May 2023 14:20:05 +0200, Nicolas Martyanoff <nicolas@n16f.net>
>>>>> said:
Nicolas> Hi,
Nicolas> I stumbled upon a strange behaviour. With the IntelOne Mono font
[1],
Nicolas> Emacs (Emacs 28.2 GUI on Linux) maps font faces as follows:
Nicolas> '((t :font "IntelOne Mono-11" :weight light)) -> "Light"
Nicolas> '((t :font "IntelOne Mono-11" :weight semi-light)) -> "Light"
Nicolas> '((t :font "IntelOne Mono-11" :weight normal)) -> "Medium"
Nicolas> '((t :font "IntelOne Mono-11" :weight medium)) -> "Medium"
Nicolas> '((t :font "IntelOne Mono-11" :weight semi-bold)) -> "Bold"
Nicolas> None of the Emacs weight maps to the "Normal" font weight (Light,
Nicolas> Medium, Normal and Bold are the name of the weights as reported by
all
Nicolas> other applications).
This has changed in emacs-29. From etc/NEWS:
*** Emacs now supports 'medium' fonts.
Emacs previously didn't distinguish between the 'regular'/'normal'
weight and the 'medium' weight, but it now also supports the (heavier)
'medium' weight. However, this means that if you specify a weight of
'normal' and the font doesn't have this weight, Emacs won't find the
font spec. In these cases, replacing ":weight 'normal" with ":weight
'medium" should fix the issue.
Would it be possible to check with emacs-29?
Nicolas> From a quick search, Emacs uses font-weight-table to map numeric
font
Nicolas> weights to symbolic weights, but I cannot find any link between
these
Nicolas> numeric values and the weight names reported by other applications.
Nicolas> Is there something I can do to control (or at least understand)
the way
Nicolas> weights are mapped?
I once understood some of it, but Iʼve long since repressed that info
:-)
Robert
--