Skip to main content

Microsoft Silverlight

Answered Question FontStretch / FontWeight?RSS Feed

(0)

buster.t
buster.t

Member

Member

22 points

15 Posts

FontStretch / FontWeight?

Hello,

 I am using a basic TextBlock, however, it doesn't seem the FontStretch or FontWeight properties work.  No matter what value I set, the appearance of the text does not change.  Do these properties only work with certain fonts?  If so, can you please tell me of a font where these values will work?  Can somebody show me a working example of using either of the FontStretch or FontWeight?  This seems so weird.

Thank you!

cookendorfernick
cookendo...

Member

Member

424 points

99 Posts

Re: FontStretch / FontWeight?

You are probably not putting in the correct values for the FontWeight and FontStretch. Try something like <textblock FontWeight="ExtraBold" .../>

-Nick

Also, please "Mark As Answer" if this answered your question.

buster.t
buster.t

Member

Member

22 points

15 Posts

Re: FontStretch / FontWeight?

I have tried the following without any luck 

 <TextBlock FontFamily="Arial" FontSize="12" FontWeight="Thin" Text="Thin"></TextBlock>
 <TextBlock FontFamily="Arial" FontSize="12" FontWeight="Light" Text="Light" Canvas.Top="30"></TextBlock>
 <TextBlock FontFamily="Arial" FontSize="12" FontWeight="Bold" Text="Bold" Canvas.Top="60"></TextBlock>
 <TextBlock FontFamily="Arial" FontSize="12" FontWeight="ExtraBlack" Text="ExtraBlack" Canvas.Top="90"></TextBlock>

If I use the FontStretch property, it does not work either.  Everything renders the same.  Do you have any suggestions?

cookendorfernick
cookendo...

Member

Member

424 points

99 Posts

Re: FontStretch / FontWeight?

OK. I have seen this before. This is probably due to your default font. Change to a different font, I.E. Times New Roman. And then you should be able to set this.

Also, try

<TextBlock FontFamily="Times New Roman" FontSize="12" FontWeight="ExtraBlack" Text="ExtraBlack" Canvas.Top="90" FontStretch="Expanded"></TextBlock>

-Nick

Also, please "Mark As Answer" if this answered your question.

buster.t
buster.t

Member

Member

22 points

15 Posts

Re: FontStretch / FontWeight?

I may be asking the wrong question.  How do you know what fonts support font weights and font stretching?  Are there any that support both?

Thank you!

cookendorfernick
cookendo...

Member

Member

424 points

99 Posts

Answered Question

Re: FontStretch / FontWeight?

Here is the only answer I can find for you regarding this in Silverlight.

If a font doesn't support a weight or style we currently (for v1) do not generate algorithmic bolded/italic versions of that font. This is why specifying Bold with the default font doesn't do anything.

-Nick

Also, please "Mark As Answer" if this answered your question.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities