Here's the deal: I have this line of XAML
<Viewbox Canvas.Left="27" Canvas.Top="479" Width="377" Height="21" Stretch="Fill"
StretchDirection="DownOnly" VerticalAlignment="Top" HorizontalAlignment="Left">
<TextBlock Name="TitleText" TextWrapping="Wrap" TextAlignment="Left" FontSize="14"
FontStretch="Normal" FontStyle="Normal" Foreground="White" Width="377" >some long text here
</TextBlock>
</Viewbox>
I want the font to scale down to fit the contents height and width. What happens now is that the font scales down, but the Viewbox also scales the content horizontally, making the width of the textbox smaller. Here's an example
If I set Stretch="Fill" the text will fill the widht, but shrinks only font-size in heigth, making the font look horribly ugly Like this.
Is it possible to shrink the text to fit inside a frame so that it uses the whole width and height of the container?
Continue the work from Marcus:
<Viewbox Canvas.Left="27" Canvas.Top="479" Width="377" Height="21" Stretch="Fill"
StretchDirection="DownOnly" VerticalAlignment="Top" HorizontalAlignment="Left">
<Viewbox Stretch="Fill" Width="Auto" Height="Auto">
<TextBlock Name="TitleText" TextWrapping="Wrap" TextAlignment="Left" FontSize="14"
FontStretch="Normal" FontStyle="Normal" Foreground="White" Width="377" >some long text here
</TextBlock>
</Viewbox>
</Viewbox>
I changed it to
Stretch="Uniform"
and
StretchDirection="Both"
and the result seems great, without stretching the word vertically.