On Windows 11, I installed the latest version of Cascadia Code (2404.23). Then, in Emacs 29.2, I clicked on Set Default Font... in the Options menu. In the resulting dialogue, I selected Cascadia Code and was offered a lot of font styles including ExtraLight and Light. Light is clearly lighter than Regular and ExtraLight is clearly lighter than Light. I selected Light and size 11. Closing the dialogue and clicking on Save Options in the Options menu wrote the following to my .emacs file:
(custom-set-faces '(default ((t (:family "Cascadia Code Light" :foundry "outline" :slant normal :weight light :height 108 :width normal))))) Based on that, I tried (set-face-attribute 'default nil :family "Cascadia Code Light" :height 108) which seems to work correctly. (set-face-attribute 'default nil :family "Cascadia Code Light" :weight 'light :height 108) also works, but specifying the weight explicitly seems to be redundant. I presume this recipe will also work for the fixed-pitch font, but I haven't tried it. Best of luck! Francis ________________________________ From: help-emacs-windows-bounces+f.j.wright=live.co...@gnu.org <help-emacs-windows-bounces+f.j.wright=live.co...@gnu.org> on behalf of Chang Xiaoduan <dr...@sina.com> Sent: 11 September 2024 9:00 AM To: help-emacs-windows@gnu.org <help-emacs-windows@gnu.org> Subject: Can not change face weight on Windows Hello, I am trying to use Cascadia Code<https://github.com/microsoft/cascadia-code.git> for the default and fixed-pitch faces in Emacs. However, I feel the regular weight too dense for me, so I want to use the light version. I have the following code in my init.el file: (set-face-attribute 'default nil :font "Cascadia Code" :weight 'light :height 160) (set-face-attribute 'fixed-pitch nil :font "Cascadia Code" :weight 'light :height 1.0) However, evaluating these expressions does not make any change. Executing describe-face on default and fixed-pitch shows that the weight is still regular. I have doubted that this issue is exclusive on Windows, so I installed the same font files and evaluated the same code on a Linux virtual machine. This time, Emacs correctly sets the weight to light. So, is this a bug on Emacs? Is this a problem of Windows? Any chance this behavior can be fixed? Thanks for any help. Regards, – Chang Xiaoduan