6

When I use RenderTransform property and scale up a RichTextBox I get magnified text which is pixelized (square text edges).

How I can prevent this? enter image description here

EDIT:

I have TextOptions.TextFormattingMode="Display" - when I remove this option everything is fine!

Alfa07
  • 3,314
  • 3
  • 26
  • 39

2 Answers2

2

Cannot claim that i can reproduce this with my current settings:

enter image description here

That is with a scale of 20. I think this could be dependent on the ClearType system settings, you can try setting RenderOptions.ClearTypeHint="Enabled" on the RichTextbox, that might enforce it.

Also try setting TextOptions.TextRenderingMode="ClearType".

Edit: This SO question deals with text-rendering quite in-depth and might be helpful.


Edit: Check out this weirdness:

<TextBlock Text="Lorem ipsum dolor sit"
           FontSize="20" TextOptions.TextFormattingMode="Display">
     <TextBlock.RenderTransform>
           <ScaleTransform x:Name="trans" ScaleY="10" ScaleX="10"/>
     </TextBlock.RenderTransform>
     <TextBlock.Triggers>
        <EventTrigger RoutedEvent="Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation To="20" Duration="0:0:5"
                                     Storyboard.TargetName="trans" Storyboard.TargetProperty="ScaleX"/>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
     </TextBlock.Triggers>
</TextBlock>

As soon as a certain scale is reached the text becomes clear for me, really odd...

Community
  • 1
  • 1
H.B.
  • 166,899
  • 29
  • 327
  • 400
  • If I keep TextOptions.TextFormattingMode = "Display" and add RenderOptions the pixelization stays :( – Alfa07 May 03 '11 at 06:59
  • `TextOptions.TextFormattingMode="Display"` seems to effectively kill all efforts to make it look nice... – H.B. May 03 '11 at 08:03
  • What font are you using? Just making sure you aren't using a bitmapped font. – Kevin Hsu May 03 '11 at 08:10
  • @Kevin Hsu: I doubt that this is the issue, not even one of my installed fonts pixelates on normal settings. – H.B. May 03 '11 at 08:18
1

This worked for me:

TextOptions.TextFormattingMode="Ideal"

as suggested on: http://www.newventuresoftware.com/blog/wpf-text-rendering-quirks-scaletransform