Hi, there I use the popular Seoge UI font in my WPF application. And almost every position (like- Textbox,Grid,). I use the Fontsize =10 because in this size some letter are good looking. My problem is my application is DPI aware that means it changes it's size according to the screen resolution and DPI.
I do this using the DPI decorator class.
Here is the code of that class -
public class DpiDecorator : Decorator
{
public DpiDecorator()
{
this.Loaded += (s, e) =>
{
System.Windows.Media.Matrix m = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice;
ScaleTransform dpiTransform = new ScaleTransform(1 / m.M11, 1 / m.M22);
if (dpiTransform.CanFreeze)
dpiTransform.Freeze();
this.LayoutTransform = dpiTransform;
};
}
}
And after that I apply the DPI decorator in my Grid like this way -
<local:DpiDecorator>
<Grid>
</Grid>
</local:DpiDecorator>
As I say previously I use the Fontsize=10 because of good looking, I want to scale this font size into bigger and smaller according to it's parent controls that means in most of the cases I use the Text box to write anything on my UI.
My problem is If I run my application on another computer everything is OK that means the UI is automatically scaled and get bigger and smaller depending upon the DPI decorator and the fluent design of my UI. But the text on UI are looking blurry and small and looks like not properly increased it's size according to the UI.
How I solved this issue?
Though I found some solution on Stack overflow but that does not work.