all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Jesse Sheidlower <jester@panix.com>, 51277@debbugs.gnu.org
Subject: bug#51277: 27.1; menu-set-font not loading correct font
Date: Wed, 20 Oct 2021 17:02:23 +0200	[thread overview]
Message-ID: <87ee8f3fk0.fsf@gmail.com> (raw)
In-Reply-To: <83cznzc1p8.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 20 Oct 2021 15:36:51 +0300")

>>>>> On Wed, 20 Oct 2021 15:36:51 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> Date: Wed, 20 Oct 2021 07:30:21 -0400
    >> From: Jesse Sheidlower <jester@panix.com>
    >> Cc: Eli Zaretskii <eliz@gnu.org>, 51277@debbugs.gnu.org
    >> 
    >> There is no difference in the result: whether I restrict emacs to xfont,
    >> ftfont, or ftcrhb, it still loads the "Bold" file even when I select the
    >> "Book" version from menu-set-font.
    >> 
    >> Where does this leave us? It does still seem like a bug (albeit one that
    >> apparently affects very few people).

    Eli> Are you familiar with debugging with Edebug and/or with running Emacs
    Eli> under GDB?  If so, perhaps you could step into the relevant code and
    Eli> tell us what happens there with this font, so we could understand the
    Eli> root cause(s) of this.

tl;dr font weight handling is a mess

    Eli> Or maybe someone else who can install that font and sees the problem
    Eli> could do that.

Iʼve installed the fonts in question, and I can reproduce the
issue. What I see:

- the GTK font selector lets us choose 'Operator Mono Book'
- the resulting weight according to Pango is '330', which we map to
  'normal' [1]

Comparing that to what 'fc-match' tells us:

    $ fc-match 'operator mono:weight=330'
    FontsFree-Net-OperatorMono-Bold.ttf: "Operator Mono" "Bold"

    $ fc-match 'operator mono'
    FontsFree-Net-OperatorMono-Bold.ttf: "Operator Mono" "Bold"

    $ fc-match 'operator mono:style=book'
    FontsFree-Net-OperatorMono-Book.ttf: "Operator Mono" "Book"

    $ fc-match 'operator mono:light'
    FontsFree-Net-OperatorMono-Book.ttf: "Operator Mono" "Book"

So Iʼd be willing to point the finger at the font here, except that
with gedit, when I select 'Operator Mono Book', I get the 'book'
version, not 'bold'.

I then cavalierly hardcoded the weight we request to '200', which
results in us asking for 'light', and then we correctly use the 'Book'
version of the font.

This means we should adjust XG_WEIGHT_TO_SYMBOL. It currently assigns
anything in the range <100-200] to 'light', which just seems wrong. It
all depends whether the fixed values are the start or the end of the
range, but would it not make more sense to have 'light' be used for
the range [300-350> which corresponds to
[PANGO_WEIGHT_LIGHT-PANGO_WEIGHT_SEMILIGHT> ? [2]

Robert

Footnotes:
[1]  According to the pango headers, 'book' == 380

[2]  Iʼll note that 'w32_to_fc_weight' uses the various FW_* constants
     as the start of the respective range, not the end

-- 





  reply	other threads:[~2021-10-20 15:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 22:08 bug#51277: 27.1; menu-set-font not loading correct font Jesse Sheidlower
2021-10-19 11:08 ` Eli Zaretskii
     [not found]   ` <YW64Fi5/BIFRQ0R5@panix.com>
2021-10-19 12:43     ` Eli Zaretskii
2021-10-19 13:08       ` Jesse Sheidlower
2021-10-19 15:58         ` Eli Zaretskii
2021-10-19 16:47           ` Jesse Sheidlower
2021-10-19 17:29             ` Eli Zaretskii
2021-10-19 18:08               ` Jesse Sheidlower
2021-10-19 18:14                 ` Eli Zaretskii
2021-10-19 18:17                   ` Jesse Sheidlower
2021-10-20  8:50                     ` Robert Pluim
2021-10-20 11:30                       ` Jesse Sheidlower
2021-10-20 12:36                         ` Eli Zaretskii
2021-10-20 15:02                           ` Robert Pluim [this message]
2021-10-20 15:12                             ` Lars Ingebrigtsen
2021-10-20 15:20                               ` Robert Pluim
2021-10-20 16:22                               ` Eli Zaretskii
2021-10-21  2:13                                 ` Lars Ingebrigtsen
2021-10-21  2:11                             ` Lars Ingebrigtsen
2021-10-21  7:40                               ` Robert Pluim
2021-10-21 12:59                                 ` Lars Ingebrigtsen
2021-10-21 15:37                                   ` Robert Pluim
2021-10-22 14:27                                     ` Lars Ingebrigtsen
2021-10-20 12:31                       ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ee8f3fk0.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=51277@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jester@panix.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.