We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ClearType doesn't work with some Window types

Hi,

I am working on a project which uses RibbonWindow / ChromelessWindow / SampleLayoutWindow, and I found some inconsistencies in text rendering:

In RibbonWindow / SampleLayoutWindow, ClearType rendering is disabled by default and cannot be enabled again by using TextOptions.TextRenderingMode="ClearType".

However for ChromelessWindow which uses ClearType as default, I can simply use TextOptions.TextRenderingMode="Grayscale" in xaml to disable ClearType.

This issue is quite easy to reproduce so I think I don't have to post any images. Is this a bug? Can I enable ClearType for all Window types?

11 Replies

VR Venkateshwaran Ramdoss Syncfusion Team June 27, 2016 11:13 AM UTC

Hi Hongbin,

We have checked the reported issue by creating a sample. But we were unable to reproduce the reported issue. In our samples, we have used "TextOptions.TextFormattingMode" as "Display" and "TextOptions.TextRenderingMode" as ClearType. Please download the samples from the below link.

Sample1: RibbonWindowCleartypeSample
Sample2: ChromelessWindowtextoptiontestsample

We suspect that you did not use the "TextOptions.TextFormattingMode" as "Display" in your sample. By default, its value is Ideal. When it is in Ideal, the changes are not applied. Please check by setting the property "TextOptions.TextFormattingMode" as "Display".

Regards,
Venkateshwaran V.R.



HZ Hongbin Zou June 27, 2016 12:54 PM UTC

Hi Venkateshwaran,

Thanks for your response. I checked your samples and found that I was modifying the demo solutions shipped with Syncfusion, which is very different from your way of building the xaml from scratch. Sorry I didn't mention that before.

However I believe the problem still exists. Let's look at the Syncfusion demos:

Demo A install directory: %userprofile%\AppData\Local\Syncfusion\EssentialStudio\14.2.0.26\WPF\SfGrid.WPF\Samples\GettingStarted\CS
Demo B install directory: %userprofile%\AppData\Local\Syncfusion\EssentialStudio\14.2.0.26\WPF\Tools.WPF\Samples\Ribbon\Office2013\CS

For demo A (ChromelessWindow), I could enable ClearType easily using your method, but for demo B (RibbonWindow) I just couldn't figure out a way to enable ClearType. I also tried to add syncfusion:LayoutControl.SetMetroMode="True" (which appeared in demo A) to demo B but to no avail.

So this time my question is simple: how to enable ClearType for demo B?


VR Venkateshwaran Ramdoss Syncfusion Team June 28, 2016 10:59 AM UTC

Hi Hongbin,

We have checked in our Ribbon Office2013 demo sample. But we were unable to reproduce the reported issue. When we set the "TextOptions.TextFormattingMode" as "Display" and "TextOptions.TextRenderingMode" as "ClearType" in the RibbonWindow, it is working fine. We can see the difference of all the Modes of TextRendering. Could you please provide more details like how you have set the "TextFormattingMode" and "TextRenderingMode" in your application. It will help to proceed further.

Regards,
Venkateshwaran V.R.



HZ Hongbin Zou June 28, 2016 07:56 PM UTC

Ah, that's weird. I am from mainland China, using VS2013 with the latest Win10 build 1511 (10586.420) and my default system language is Chinese (Simplified). Could my system language be the reason? I tried to switch my system language to en-us, but the problem still exists, so I'm not sure.

I also have to tell you when it comes to Chinese font rendering, There is another problem (for my machine). According to the uploaded images and VS projects:

1. This time, ClearType doesn't work for ChromelessWindow.
2. The rendering details of Chinese texts are different (actually it looks inelegant) from the system default. I have seen those bad renderings before and I think this is because of some incompatibility between Chinese (Simplified) and Chinese (Traditional), but still I'm not sure.

The only difference between the two uploaded projects is switching from Window to ChromelessWindow.

I know what I mentioned above might be difficult for you to verify, anyway, apart from those little imperfections, your products are really wonderful, thanks!

Attachment: Projectsandscreenshots_400e0e09.zip


HZ Hongbin Zou June 28, 2016 08:08 PM UTC

I believe it's best to find someone from mainland China to verify problem 2. Chinese fonts are actually different among mainland China/Hong Kong/Taiwan.


VR Venkateshwaran Ramdoss Syncfusion Team June 29, 2016 12:35 PM UTC

Hi Hongbin,

In your first update you have mentioned that there is a issue in RibbonWindow and not in ChromelessWindow. But in your last update you have mentioned that issue reproduced in ChromelessWindow.
Can you please confirm in which issue get reproduced? Also please update whether the issue reproduce only after adding Chinese words in the application.

Also please update whether this issue reproduced only in one machine or in all other machines. These details will help us to narrow the issue.

Regards,
Venkateshwaran V.R.


HZ Hongbin Zou July 2, 2016 08:00 AM UTC

Sorry for the late reply, I was too busy to make a thorough test in weekdays.

I also have this confusion for ChromelessWindow. In some cases ClearType works, others don't. I'll show you what I found.

This time I uploaded 3 solutions together with their screenshots:

1. DefaultFontRendering: This is created solely with WPF built-in controls. Of course it works correctly. If I set "TextOptions.TextRenderingMode" as "ClearType", I can see ClearType, and If I set "TextOptions.TextRenderingMode" as "GrayScale", I can see GrayScale. 

2. SfFontRendering: The only difference between DefaultFontRendering and SfFontRendering is switching from Window to ChromelessWindow. This time, I can only see GrayScale no matter what value I set to "TextOptions.TextRenderingMode".

3. SfWithMetro: The only difference between SfFontRendering and SfWithMetro is adding syncfusion:LayoutControl.SetMetroMode="True" to SfWithMetro (and a reference to Syncfusion.SampleLayout.dll). This is the same method used in your demos. This time, ClearType and GrayScale options works again, although the window is a ChromelessWindow.

Note that when used ChromelessWindow, the rendering details of Chinese texts are different from system default.

And back to my first post, when the window is a RibbonWindow, even setting syncfusion:LayoutControl.SetMetroMode="True" cannot make ClearType work.

The issue occurs no matter what characters I add to the app. For the SfFontRendering project, even if I remove all the controls, I can still see the "MainWindow" title rendered using GrayScale.

Also, the issue occurs in all the Win7/Win10 computers I can find (Win7 also have this issue. See SfFontRendering/win7.png), The system language of them are all Chinese (Simplified).

Attachment: Projects_6dc61b74.zip


HZ Hongbin Zou July 2, 2016 08:31 AM UTC

Hi, I just find someone with the same phenomenon I described, see here:

https://www.syncfusion.com/forums/124828/some-issues-and-confusions-about-qat

Although his thread is not about text rendering, you can see that in the first image posted, texts are rendered with ClearType while in the 2nd image, all texts are GrayScale. And it looks that he is also from China because he is using a Chinese font. There is something wrong for rendering Chinese and probably other languages.


HZ Hongbin Zou July 2, 2016 08:44 AM UTC

"Note that when used ChromelessWindow, the rendering details of Chinese texts are different from system default."

To be clear, by "the rendering details of Chinese texts" I mean stroke details. Those strokes are not the way they are in Simplified Chinese (maybe Traditional Chinese I guess). 

Also note that this stroke issue doesn't occur all the time. when using font "Microsoft YaHei", which is the default font used in Win7/8/10, stroke details are incorrect. For font "KaiTi", stroke details are correct.


HZ Hongbin Zou July 2, 2016 09:11 AM UTC

In this post by Nick Tang (see link below), you can see that the main window is rendered ClearType while the context menu is rendered GrayScale. Inconsistent, right? I don't really think he is doing this on purpose.

https://www.syncfusion.com/forums/124092/strange-behavior-of-customized-menu-item-of-document-tab-item


MS Mariappan S Syncfusion Team July 7, 2016 12:59 PM UTC

Hi Hongbin, 

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 


Please let me know if you have any questions. 

Regards, 
Mariappan S. 


Loader.
Live Chat Icon For mobile
Up arrow icon