GNU bug report logs -
#45920
28.0.50; set-face-attribute cannot read :family when different :weight exist
Previous Next
Full log
View this message in rfc822 format
> From: Protesilaos Stavrou <info <at> protesilaos.com>
> Date: Sat, 16 Jan 2021 22:09:54 +0200
>
> ;; Sample 1
> (set-face-attribute 'default nil
> :family "Source Code Pro"
> :weight 'light)
>
> ;; Sample 2
> (set-face-attribute 'default nil
> :family "Hack"
> :weight 'normal)
>
> If you evaluate sample 1, you will get the desired behaviour. Namely,
> the font family for the default face is the one specified, as is the
> typographic weight.
>
> Now if you proceed to evaluate sample 2, you will notice that only the
> weight gets updated. The family continues to be that of sample 1.
>
> At this point, to get the family of sample 2, you need to evaluate
> sample 2 one more time.
>
> I tried various combinations and my impression is that the problem
> occurs when the :weight properties are different. Other properties,
> such as :height, do not exhibit this behaviour.
I didn't try to reproduce, because I don't have one of these fonts.
However, it might be relevant that when you call set-face-attribute
with several attributes related to the face's font, the underlying
primitive, internal-set-lisp-face-attribute, is called multiple time,
one time for every attribute. So the order of those calls might
matter, especially if one of the fonts doesn't support some of the
values of all the attributes (e.g., the 'normal' weight in this case).
This bug report was last modified 4 years and 176 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.