[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] Add fontaine package?
From: |
Protesilaos Stavrou |
Subject: |
Re: [ELPA] Add fontaine package? |
Date: |
Fri, 29 Apr 2022 10:23:52 +0300 |
User-agent: |
Notmuch/0.35 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> From: Eli Zaretskii <eliz@gnu.org>
> Date: Fri, 29 Apr 2022 10:15:33 +0300
>
>> > Sorry, I meant set-face-attribute, of course.
>>
>> The reason I did not use it is due to what we discussed in bug#45920.
>> Basically, set-face-attribute needs to be evaluated twice when (i) we
>> change the :family, (ii) change the :weight, and (iii) the new family
>> does not have the weight of the previous one.
>>
>> The example I used in that bug report, which I can still reproduce with
>> emacs -Q:
>>
>> ;; Sample 1
>> (set-face-attribute 'default nil
>> :family "Source Code Pro"
>> :weight 'light)
>>
>> ;; Sample 2
>> (set-face-attribute 'default nil
>> :family "Hack"
>> :weight 'normal)
>>
>> Evaluate sample 1. It works. Now evaluate sample 2. Notice that it
>> does not yield the expected result. Evaluate sample 2 again: the result
>> is the desired one.
>>
>> By using internal-set-lisp-face-attribute, I specify the sequence of
>> events that always works.
>>
>> Perhaps there is a better way to handle this edge case?
>
> What exactly is the "edge case", and why do you need it in this
> package?
It is possible to have a typeface that has a light weight and another
that hasn't. If the user defines two presets in fontaine-presets and
tries to switch from the one with the light weight to the other without
it, they will encounter the aforementioned behaviour of
set-face-attribute.
--
Protesilaos Stavrou
https://protesilaos.com
- [ELPA] Add fontaine package?, Protesilaos Stavrou, 2022/04/27
- Re: [ELPA] Add fontaine package?, Stefan Monnier, 2022/04/27
- Re: [ELPA] Add fontaine package?, Richard Stallman, 2022/04/27
- Re: [ELPA] Add fontaine package?, Eli Zaretskii, 2022/04/28
- Re: [ELPA] Add fontaine package?, Protesilaos Stavrou, 2022/04/28
- Re: [ELPA] Add fontaine package?, Eli Zaretskii, 2022/04/28
- Re: [ELPA] Add fontaine package?, Protesilaos Stavrou, 2022/04/29
- Re: [ELPA] Add fontaine package?, Eli Zaretskii, 2022/04/29
- Re: [ELPA] Add fontaine package?,
Protesilaos Stavrou <=
- Re: [ELPA] Add fontaine package?, Eli Zaretskii, 2022/04/29
- Re: [ELPA] Add fontaine package?, Protesilaos Stavrou, 2022/04/29