ClearType partially not working
I want to see ClearType on all my Controls as far it is possible (not possible with some sorts of clipping, opacity, fading ...). The grayscaled antialiased text is a pain in the eyes which cannot be accepted in professional apps.
I'm just using the MetroWindow with standard controls like TextBlock, Label and TextBox.
First thing I does not understand, is that ClearType is not enabled by Default. So the only special setting I do is RenderOptions.ClearTypeHint="Enabled". Now the TextBlock and the small Label shows up correct - the long Label and the TextBoxes does not!
Result:
(see the coloured pixels versus the grayscaled ones)
Code to reproduce:
<controls:MetroWindow x:Class="MetroClearTypeTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="MainWindow" Height="350" Width="525"
RenderOptions.ClearTypeHint="Enabled"
>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="137*"/>
<ColumnDefinition Width="380*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock TextWrapping="Wrap" Text="ClearType Test" />
<Label Content="Small Label Text"></Label>
<TextBox Text="Text Of TextBox"></TextBox>
<Label Content="a veeeryyy loooong Label Text"></Label>
<TextBox Text="Text Of TextBox"></TextBox>
</StackPanel>
</Grid>
</controls:MetroWindow>
If you change MetroWindow to Window, everything looks fine. I saw the issues #889 and #1156 but this doesn't help - as far as I understand the problem should be fixed in current version. This my Environment: Using latest Version of MahApps from Nuget 0.14.0 (same problem with current clone),VS2013, Win 8.1 Thanks for any comment ;-)
@BerndK try set TextOptions.TextFormattingMode="Display" too
Hi Jan, sure I tried
TextOptions.TextRenderingMode="ClearType"
TextOptions.TextFormattingMode="Display"
but nothing helps.
@BerndK don't know what's going wrong with your code. i've tested it with a simple mahapps window and for me it works...

it exists many reasons why ClearType not works...
http://blogs.msdn.com/b/text/archive/2010/01/15/cleartypehint.aspx http://arbel.net/2007/02/03/give-me-back-my-cleartype/
Hi Jan,
you are cheating ;-)
in my example the space for the label wasn't enough (the text was veeeryy looong), in your example the label has more space (no clipping) and it works (the same as my first Label).
Anyway your Textboxes are NOT ClearType, they are antialiased (gray pixels), but not coloured ones (ClearType).
This is a zoomed part of your picture!
As you can see the TextFormattingMode does not change the view. Hint: I use the screen lens with 300% then you can see very quick what's going on. (start the screen lens by typing "Center für erleichterte Bedienung" on a german Windows.)
Hmm... this issue seems to be specific to TextBox in this case. Works fine for Label and TextBlock though.
The RenderOptions.ClearTypeHint="Enabled" set at Window-level isn't being applied to TextBox.
Sorry, but the Label and TextBlock only works as long as there is enough space. If the content is clipped (because not enough space to write all the text) there is no more ClearType.
Using the lens you can see that there are many other Controls that are not ClearType, when you examine the official Demo App "MetroDemo.NET45". To see this, first you have to switch ClearType on with RenderOptions.ClearTypeHint="Enabled"
Whoa... nice observation on the clipped contents! I didn't notice them earlier... :) Makes me wondering what the root cause of this issue on those problematic controls is... Is it Opacity?
@BerndK maybe i found it. the WindowChrome (WindowChromeWorker) sets the background to transparent.
// Apply the transparent background to the HWND
//_hwndSource.CompositionTarget.BackgroundColor = Colors.Transparent;
if i comment the line, the cleartype comes back...

@BerndK i will try it tomorrow on a win 7 system (tested actually under win 8.1), if it works without any side effect, then i should change it.
These are good news. Now it seems that I have found a really cool Theme for professional looking (and readable) apps. Thanks for all the work Jan.
Whoa! Right on. And ClearType suddenly correctly applied. Even without explicitly setting RenderOptions.ClearTypeHint="Enabled"... :D
Would that have any side effect?
I've tested your last modification. Almost everything of the DemoApp looks correct. The only thing I saw was the ComboBox:
Here the Value of the comboBox looks OK, but the List is not ClearType. This topic is not mission critical, because most time comboboxes are closed.
@BerndK that's an issue by the combobox itself, the popup uses AllowTransparency="True" to work with non aero windows themes. but this breaks always the clear type!
@BerndK @mahara no time to test #1537 ?
OK, I'll take a look at it. Thanks.
@punker76 Just tested it, and the fix seems to be working to me. Also it's that actually fixes my previous issue (https://github.com/MahApps/MahApps.Metro/issues/889) when ClearType doesn't get applied on DataGrid, ComboBox, and ListBox. Thanks a lot, Jan!
I tested it, everything (including ComboBoxes and menuItems) is looking pretty fine now. I would suggest to remove the left comments in Controls.ComboBox.xaml and Controls.ContextMenu.xaml or are thy still needed?
Sorry for my delay, I'm in holidays and therfore only partial online and only limited time at the machine ;-)
@BerndK no worries! i remove the comments and put a simple guide to the mahapps page.