3

I have a simple XAML example:

<Grid>
<Button x:Name="button1" FontSize="28" FontWeight="Bold" FontStyle="Oblique" HorizontalContentAlignment="Center" Margin="296,142,296,249">
<TextBlock Width="Auto" Text="button" Padding="0" VerticalAlignment="Center"/>
</Button>
<Button x:Name="button2" Content="button" FontSize="28" FontWeight="Bold" FontStyle="Oblique" Margin="296,234,282,146" />       
</Grid>

If height of any button will changed in design mode (or added and changed property Height in xaml), the part of last letter of text in textblocks will surprisingly cut from right side.

here is an image how the cutting of letter looks

The error is only presents on oblique font style ('italic' or 'normal' looks good). Looks like text blocks have uncorrect calculated borders of width in this case.

It can be fixed by changing Padding property (Padding="0,0,6,0"). But it's not a good practice I think.

Could anyone advice how to show oblique fontstyle text correct?

mrogal.ski
  • 5,828
  • 1
  • 21
  • 30
AOD
  • 31
  • 1
  • It also happens with Italic, just not so clearly visible. – Clemens Aug 08 '18 at 10:50
  • Odd, it seems to be related to the height as well. If you increase the height of that top button by just a few pixels it no longer clips the width. – Jeff R. Aug 08 '18 at 20:12
  • Yes, seems that enough height will fix it. But it not fix my problem, cause height must not influence to the width, it's not a normal. Looks like it default wpf bug. =( – AOD Aug 09 '18 at 14:00

0 Answers0