There are certain situations where ClearType will be disabled in the rendering path, which means that it will then return to anti-aliasing using gray:
When you use AllowsTransparency="True" on Window
When ClearType is disabled in Windows settings (and you did not use TextOptions.TextRenderingMode = "ClearType" to force ClearType to be used)
ClearType text does not display correctly on a background that is not completely opaque, and you enter some transparency.
If text is passed to an intermediate target due to use:
- the visual
- DrawingBrush
- Opacitymask
- Viewport2DVisual3D
- Effect
- Bitmap effect
Are you TextOptions.TextFormattingMode="Display" top-level element, that is, a window? (the property is inherited, so if you put it there, it should apply to everything in your window).
You can use RenderOptions.ClearTypeHint="Enabled" to re-enable ClearType in the rendering path, but you may have artifacts because there is usually a reason to disable it.
You can use TextOptions.TextHintingMode="Fixed" when you have an animation, and you do not want to render text of lower quality (i.e. ClearType is disabled) when the animation is in effect.
You can use TextOptions.TextRenderingMode="ClearType" to force the use of ClearType, even then the Windows system settings did not enable it (in this case it will not be anything special for you, this is for reference).
source share