dotNET
dotNET

Reputation: 35380

Why FontWeights.Regular displays the same as FontWeights.Normal?

Has anyone else seen this? Is this a known bug and is there a fix for it?

Just create an empty Window and paste this inside:

<ComboBox Width="200">
  <x:Static Member="FontWeights.Normal"/>
  <x:Static Member="FontWeights.Regular"/>
</ComboBox>

Run it or just check in the designer (by placing cursor inside any of the two items). ComboBox displays both items as Normal. I checked FontWeights class too; there is no extra attribute or anything on any of the two static members. What's going on here?

Upvotes: 1

Views: 506

Answers (2)

Kcvin
Kcvin

Reputation: 5163

They have equivalent values as seen by the source

More specifically when FontWeightToString is called (during ToString()), it is returning "Normal" for both FontWeights.

Upvotes: 1

Josh
Josh

Reputation: 697

As per MSDN: https://msdn.microsoft.com/en-us/library/system.windows.fontweights.regular(v=vs.110).aspx in the Remarks section:

"Regular is equivalent in font weight to Normal."

The class definition probably also makes things a bit clearer too: http://www.dotnetframework.org/default.aspx/DotNET/DotNET/8@0/untmp/WIN_WINDOWS/lh_tools_devdiv_wpf/Windows/wcp/Core/System/Windows/FontWeights@cs/1/FontWeights@cs

Upvotes: 0

Related Questions