Can not change face weight on Windows

Chang Xiaoduan <[email protected]> Wed, 11 Sep 2024 16:00:39 +0800
Newsgroups gmane.emacs.windows
Message-ID <[email protected]>
--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain
Content-Disposition: inline

Hello,

I am trying to use [Cascadia Code] 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*


[Cascadia Code] <https://github.com/microsoft/cascadia-code.git>

--==-=-=
Content-Type: text/html; charset=gbk
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html xmlns=3D"http://www.w3.org/1999/xhtml" lang=3D"en" xml:lang=3D"en"><h=
ead><!-- 2024-09-11 =D6=DC=C8=FD 16:00 --><meta http-equiv=3D"Content-Type"=
 content=3D"text/html;charset=3Dutf-8"/><meta name=3D"viewport" content=3D"=
width=3Ddevice-width, initial-scale=3D1"/><meta name=3D"generator" content=
=3D"Org Mode"/></head><body>
<div style=3D"font-family:&quot;Arial&quot;;font-size:10pt;line-height:11pt=
;" id=3D"content">
<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
Hello,<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
I am trying to use <a style=3D"color:#0071c5;" href=3D"https://github.com/m=
icrosoft/cascadia-code.git">Cascadia Code</a> for the <code style=3D"font-s=
ize:10pt;font-family:monospace;background:#f9f9f9;">default</code> and <cod=
e style=3D"font-size:10pt;font-family:monospace;background:#f9f9f9;">fixed-=
pitch</code> faces<br/>
in Emacs. However, I feel the regular weight too dense for me, so I<br/>
want to use the light version.<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
I have the following code in my <code style=3D"font-size:10pt;font-family:m=
onospace;background:#f9f9f9;">init.el</code> file:<br/></p>

<div style=3D"margin-top:10px;font-family:&quot;Arial&quot;;font-size:10pt;=
line-height:11pt;">
<pre style=3D"line-height:12pt;color:SystemWindowText;background-color:Syst=
emWindow;margin:0px;font-size:9pt;font-family:monospace;">(set-face-attribu=
te 'default nil
              <span style=3D"color: #731c52;">:font</span> <span style=3D"c=
olor: #2f3f83;">&quot;Cascadia Code&quot;</span>
              <span style=3D"color: #731c52;">:weight</span> 'light
              <span style=3D"color: #731c52;">:height</span> 160)
(set-face-attribute 'fixed-pitch nil
              <span style=3D"color: #731c52;">:font</span> <span style=3D"c=
olor: #2f3f83;">&quot;Cascadia Code&quot;</span>
              <span style=3D"color: #731c52;">:weight</span> 'light
              <span style=3D"color: #731c52;">:height</span> 1.0)
</pre>
</div>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
However, evaluating these expressions does not make any<br/>
change. Executing <code style=3D"font-size:10pt;font-family:monospace;backg=
round:#f9f9f9;">describe-face</code> on <code style=3D"font-size:10pt;font-=
family:monospace;background:#f9f9f9;">default</code> and <code style=3D"fon=
t-size:10pt;font-family:monospace;background:#f9f9f9;">fixed-pitch</code> s=
hows that<br/>
the weight is still regular.<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
I have doubted that this issue is exclusive on Windows, so I installed<br/>
the same font files and evaluated the same code on a Linux virtual<br/>
machine. This time, Emacs correctly sets the weight to light.<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
So, is this a bug on Emacs? Is this a problem of Windows? Any chance<br/>
this behavior can be fixed?<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
Thanks for any help.<br/></p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
Regards,<br/></p>

<div style=3D"font-family:&quot;Arial&quot;;font-size:10pt;margin-bottom:20=
px;font-family:&quot;Arial&quot;;font-size:10pt;line-height:11pt;" id=3D"or=
ge0ccb5b">
<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;">
=A8C<br/><b>Chang Xiaoduan</b><br/></p>

</div>
</div>
</body></html>
--==-=-=--

--=-=-=--