How to prevent text from changing in pixels when using RenderTransform?

When I use the RenderTransform property and scale the RichTextBox, I get enlarged text that is pixelated (the square colors of the text).

How can I prevent this? enter image description here

EDIT:

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

+6
source share
2 answers

I cannot claim that I can reproduce this with my current settings:

enter image description here

This is with a scale of 20. I think this may depend on the ClearType system settings, you can try setting RenderOptions.ClearTypeHint="Enabled" to RichTextbox, which can ensure its execution.

Also try setting TextOptions.TextRenderingMode="ClearType" .

Edit: This SO question is about deep text analysis and may be useful.


Edit: check 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 will become clear to me, really strange ...

+2
source

This worked for me:

TextOptions.TextFormattingMode = "Ideal"

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

+1
source

Source: https://habr.com/ru/post/887065/


All Articles