user2696366
user2696366

Reputation: 71

WPF application, fonts graphical error

I have application in C# WPF (.NET4, app runs on Windows XP Embedded) and it worked correct, but now I received screenshot and there are graphical errors around text. These errors are only around text, not button edge, nor Windows desktop.

Images: enter image description here

enter image description here

It is graphical error (hardware), or program error which can be repaired?

Upvotes: 7

Views: 377

Answers (3)

SiC
SiC

Reputation: 487

Are there any effects being applied to the text? I've seen instances where a DropShadowEffect is applied to text - this renders well on some hardware, but on other users' machines, the text looked mangled. With the drop shadow removed it rendered nicely.

See, for example, http://social.msdn.microsoft.com/Forums/vstudio/en-US/f44bce57-d67f-46d3-8161-57c80a02e893/strange-blurring-issue-when-using-shader-effect?forum=wpf

Upvotes: 0

Csaba Toth
Csaba Toth

Reputation: 10699

WPF should try to use ClearType and anti-aliasing by default to give a smoothed look out of the box. It cannot be turned off WPF Anti aliasing workaround.

There's a lot going on behind anti-aliasing, like sub-pixel anti-aliasing. http://blogs.msdn.com/b/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx. Edges are often aliased with another algorithm, that is hardware accelerated too: edge anti-aliasing. That maybe the reason you don't have problems with edges. For performance purposes the system tries to be smart and use hardware acceleration (all modern GPUs provide such). The thing what you develop is for some kind of commercial touch screen device seemingly: like electronic information booth at plaza/mall, or some control terminal in a factory, or something. These usually can have weirdo hardware in them, exotic GPUs and motherboards. Vibration and environment impact (hot day - cold night temperature change recurrence) can cause them to have glitches and hardware failures.

  1. Try to run other software too on the device, which uses ClearType anti-aliasing like WPF does also. See if only your software causes that or not. See if other WPF software causes such.
  2. You can try to turn off hardware acceleration if you can on that system, and see if software rendering improves anything. http://blogs.msdn.com/b/text/archive/2006/10/18/tips-for-improving-your-wpf-text-rendering-experience.aspx Poke around in settings also.
  3. Try to run hardware diagnostics and GPU tests, depending on what you can get to the device.

I would rule out font file corruption: that would probably make the font completely unusable, and you also report that the weird look comes with other fonts too, I don't think that all of them is corrupted. Try to run diagnostics for software error though.

Upvotes: 1

sharpguru
sharpguru

Reputation: 340

Try using:

TextOptions.TextFormattingMode="Display"

Which should use ClearType. Or you could try:

TextOptions.TextRenderingMode="Aliased"

..and see if you get better results

Upvotes: 1

Related Questions