Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug TextBlock and TextWrapping/Margin bug...
5 replies. Latest Post by CleverCoder on November 24, 2008.
(0)
Harlequin
Member
198 points
144 Posts
11-03-2008 10:01 AM |
It seems if you give yout TextBlock a margin, and put on TextWrapping, the measuring seems to be wrong.
Repro:
1) Put a TextBlock inside of a Grid2) Give the TextBlock a Margin, something like 43) Put TextWrapping="Wrap" on the TextBlock
If you do this a word like 'Hello' comes out like:HelloI had to wrap my TextBlocks in another Grid with a margin on the Grid because of this. Anyone else get this issue?
StefanWick
Contributor
2864 points
438 Posts
11-03-2008 11:06 AM |
Can you include the repro XAML? Does setting UseLayoutRounding="False" help?
Thanks, Stefan Wick
11-03-2008 9:54 PM |
Repro in my message was enough for me to get it. Then I noticed that the fonts we are using for this internal Microsoft thing is Segoe and other fonts in it's family. I'm guessing the measuring of the fonts are not being done correctly or something. Some we are using are segoebkc.ttf and SegoeLight.ttf. Feeling it's the new font rendering engine perhaps.
11-04-2008 12:59 AM |
Does setting UseLayoutRounding="False" help?
11-04-2008 10:08 AM |
Oddly enough, yeah that helped. I thought UseLayoutRounding was to help things like Borders not get stuck with half pixels or something, so it makes them do nice crisp ones. Unless I'm reading the property info wrong.
What is this actually doing to the Segoe-based text to help it render fully?
CleverCoder
203 points
157 Posts
11-24-2008 11:03 AM |
I can confirm that this is an issue for me as well. I have a Grid in Canvas Layout mode that contains a few text blocks. When their width is auto and the grid is set to "UseLayoutRounding" == true, the width of the text blocks don't properly adjust to the proper width and cause unnecessary wrapping. Setting UseLayoutRounding=false on the grid solves the problem.