I am rendering text but the output of small fontsizes is quite bad. This seems to be an old wpf rendering issue. But there should be solutions available, see WPF Blurry fonts issue- Solutions.
As far as i understand it comes down to setting the TextOptions.TextRenderingMode to TextRenderingMode.Aliased in order to get sharper output. I tried doing that, but the result did not change.
My question is, on wich dependency object do i need to set the renderoption? I am doing it like this:
var text = new FormattedText(...);
var textGeometry = text.BuildGeometry(position);
var drawing = new GeometryDrawing(brush, null, textGeometry);
TextOptions.SetTextFormattingMode(drawing, TextFormattingMode.Display);
TextOptions.SetTextRenderingMode(drawing, TextRenderingMode.Aliased);
theDrawing.Children.Add(drawing);
Later i am using a RenderTargetBitmap in order to render the drawings. That bitmap has also set all renderoptions like posted above. Finally this bitmap gets displayed within a Imagecontrol (all UI elements have Textoptions + Renderoptions set aswell) But no sucess... Maybe my problem is that i am using a GeometryDrawing and thus my text does not get recognized as text...
Thanx for all your input!
Edit:
UI Code:
TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display);
TextOptions.SetTextFormattingMode(this.ImageControl, TextFormattingMode.Display);
TextOptions.SetTextRenderingMode(this, TextRenderingMode.Aliased);
TextOptions.SetTextRenderingMode(this.ImageControl, TextRenderingMode.Aliased);