Skip to main content
Home Forums Silverlight Programming Programming with JavaScript FontStretch / FontWeight?
5 replies. Latest Post by cookendorfernick on October 23, 2007.
(0)
buster.t
Member
22 points
15 Posts
10-20-2007 6:27 PM |
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!
cookendo...
424 points
99 Posts
10-22-2007 9:15 AM |
You are probably not putting in the correct values for the FontWeight and FontStretch. Try something like <textblock FontWeight="ExtraBold" .../>
10-22-2007 1:50 PM |
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?
10-22-2007 3:20 PM |
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>
10-22-2007 5:24 PM |
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?
10-23-2007 2:01 PM |
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.