-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gray-scale rendering setting is not applied to Microsoft Edge, Chrome, etc. #873
Comments
I am using the rc2 released yesterday. |
DirectWrite support is still in its very early stage, there are a lot of settings that don't work properly in some applications. And I don't know how to make it run in pentile mode either. |
Windows console cmd.exe is not a GUI application. MacType doesn't work with it at all. However, mactype does work with the UWP App, the Windows terminal. |
Oops, you are right. |
I opened the ClearType Tuner (cttune.exe) and unchecked the "Turn On ClearType" checkbox there. Now the Windows Console is using gray-scale rendering fonts in it, furthermore, amazingly, Microsoft Edge is changed to use gray-scale rendering too. It looks great with MacType on my computer now. |
You're such a fan of gray-scale rendering. Is there anything the gray-scale is superior to subpixel rendering? |
At the years when Windows XP/2003 was running on my computer with a LCD monitor, characters were crisp. |
wait, i thought ClearType had to be enabled for MacType to work? |
(i also prefer greyscale rendering... in fact, LCD rendering is now disabled by default in Gnome on Linux) |
You're right, ClearType has to be enabled to make MacType work "in more situations". MacType can work without ClearType, but some APIs calls will not be intercepted. If you have a fancy display, like 4K or 8K, gray-scale is very ideal and sharpness is never a problem. Like in recent versions of Macbooks, gray-scale rendering is by default. The same goes for iPhones and iPads. |
I even deployed MacType on some server machines running Windows Server editions. Another reason why gray-scale rendering is preferred is that some applications nowadays, including the mmc.exe produced by Microsoft themselves, still lacks high DPI awareness. Those application windows are scaled by the system and the text on them looks spotty subsequently. |
in Edge, try going to the URL edge://flags/#edge-enhance-text-contrast > and change it Enabled and click restart. please let us know how you go |
never mind, that doesn't help... i was trying to work out how you got Edge to render in greyscale mode... (i realise now - by disabling ClearType) @snowie2000 i wonder how edge reads the ClearType settings ... i wonder if when MacType is in greyscale mode, MacType can trick Edge (when it opens) into thinking ClearType is disabled. the problem with this kind of approach is, the next time Microsoft changes their mind, it breaks... |
The same thought came to my mind. I just realized that it is not only Edge which depends on the setting of ClearType, but also some applications mentioned in #683. Once ClearType is disabled, their interfaces can be rendered in gray-scale. |
so the cleartype settings seem to be in i changed the only thing that puts Edge into greyscale for me is completely disabling ClearType... which kind of sucks. so everything is in greyscale due to my MacType settings, except Edge, which does its own thing. it's weird because not everyone has RGB pixels. i find it very strange Microsoft do not cater to BGR screens... |
Displays report they attributes back to windows so in theory Windows the layout is of the display and switch to the correct layout. That's the theory, I never had a chance to prove it. |
I used the ProcMon to monitor the activity of cttune.exe and found that:
|
okay i think i've worked some stuff out
i've set both I've tested and everything seems to be rendering as MacType, except for VSCodium and Edge which are using DirectWrite but in grayscale only mode. |
I set Thus I set Edge was rendered in gray-scale, antialiased. I opened cttune and it had "Turn On ClearType" unchecked. |
hmm, well that's odd. here are all my settings, everything is greyscale for me 🤔. actually i haven't checked terminal, i'll do that now (but everything else is in greyscale) |
The following is mine: Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1]
"PixelStructure"=dword:00000001
"GammaLevel"=dword:00000898
"ClearTypeLevel"=dword:00000000
"EnhancedContrastLevel"=dword:00000190
"GrayscaleEnhancedContrastLevel"=dword:00000190
"TextContrastLevel"=dword:00000002
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingGamma"=dword:000007d0
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000003 I will try yours and report later. |
Eventually I set the following values: Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000001 Both Windows Console and Microsoft Edge are now rendered with gray-scale antialias. |
that's so bizarre. that was where I started, but I could only get LCD smoothing with those settings (which is why I changed to |
I am on Win 10. |
First, I would like to say thank you all for the effort. I suffer migraines that are very severe, and have recently discovered that one of the greatest 'triggers' for them is broken subpixel rendering. I have been doing a lot of research into trying to get it to work. This issue thread in particular, has a lot of useful research, so thanks for the app and all of your time.
I can think of three which have applied to me specifically, and two which I learned from the comments by a MS developer's comment This gets a little nerdy, sorry it is a long story with lots of technical details. Since this thread is a gold mine for me, hopefully there are a few flecks in here for others. I will put a TL;DR at the bottom. For me: I have a Sony TV I use as my main display - that is, I use it the most, but it is not windows' "primary" display. This is because I also have a gaming monitor which uses Nvidia GSync, and is 165Hz refresh rate, and GSync displays should be configured as your primary monitor and besides, Windows' desktop (DWM.exe) will render frames of your windowed applications, at a single refresh rate, of the primary display, so to really get the full 165Hz (outside of fullscreen exclusive mode apps like the games themselves), it must be the primary. Slightly offtopic, but related; Linux's X11 renders frames like this too, and Linux's almost-ready Wayland renders each display's frames separately at the full refresh rate of each display. Windows recently worked around a bug in late stage Win10, previously the default behaviour was to render at the lowest frame rate of any visible application. This caused problems when the low-refresh monitor animated anything, and forced the high refresh monitor to render at the lower framerate. Lots of tearing, ruined gaming, etc. Sooo... The high refresh rate monitor must be primary, because DWM sucks and GSync rules. The monitor is a normal RGB subpixel layout, but is 1440p and accordingly, the pixel density is such that subpixel rendering is not really a necessity or extremely noticable. The Sony is specified as BGR, common for many TVs recently, but in actual fact, they use what I've been referring to as bgrBGR layout, but in writing this post, I got out the magnifying loupe I use for soldering, and I notice it is in fact bgrBGRBGR. There are actually nine subpixels per pixel, arranged in three rows of three columns. The columns are BGR as expected, but the top row of bgr is lower in maximum brightness, than the bottom two rows. So, for about 0-20% brightness of a subpixel colour, the top, darker subpixel will be lit, but the bottom two will not. For 20-60%, the brighter middle pixel will also be lit. For 60-100%, all three subpixels of that colour will be lit. I suspect that this is intended to allow a greater dynamic range, the panel has a very high contrast ratio, because the blacks can be more black because of the dark pixel row at the top and the extreme brightness of all three LEDs together reducing the need for backlighting. I always considered it to be an exceptionally pretty monitor, and only a magnifying glass told me why ;) Recently I have been looking at new gaming OLEDs, and the subpixel layouts of those are often quite unusual too, so they suffer a similar issue of not being supported by either RGB or BGR subpixel rendering. So, I would really need 'sub-sub-pixel' rendering, for sub-pixel rendering to work, because as the antialiasing demands varying brightness, it is actually changing the pixel's vertical position by up to 2/3 of the height of the pixel. I'm sure you all understand why this just doesn't work properly and even with BGR subpixel rendering, the fonts were not quite right, as the antialiasing shifted individual subpixels up and down. These sub-subpixels are tiny of course, so it is barely noticeable, but the distorted shape is .... some would say 'ugly', and for me, literally "dangerous". But, even if BGR worked on that 'main' display, then Windows will not actually allow multiple displays to render in a different subpixel layout. Yes, I know the cttuner allows it, and the registry stores it, and my browser of choice (firefox) even reads those settings and attempts to apply them, but the reality is that only the primary display's settings - those in the registry under "DISPLAY1" are ever used, on all displays. I had noticed this and also BetterClearTypeTuner author had also made this observation and accordingly only allowed a single setting. The author also recommends MacType :) So, I would have to set my primary display to BGR, to get BGR on my 'main' display, but it is RGB....and now I have the same 'wrong layout' problem on a different screen. TL;DR Also in the past I have used my monitor in 90 degree rotated fashion, more height for text for coding... and that breaks all of the subpixel layouts! So, that's my three, the other two from the MS dev were (briefly - see link above) that subpixel rendering can't be composited or animated properly. And for a bonus, I will say, that since MS have determined that increasing pixel density will render subpixel rendering obsolete, their font rendering APIs have only supported greyscale antialiasing, and so any recent windows version will always contain greyscale AA'd elements, and I prefer whatever it uses, to be used uniformly across the entire workspace. I don't want forced greyscale in the titlebars, but subpixel in the window... So, greyscale everywhere is the only way forward for me. And Windows' greyscale font rendering is unacceptably bad and often simply does not antialias at all. So MacType in greyscale is my only hope until Wayland is ready so I can switch to linux. Now, with the help of the advice in this thread, I think maybe I can get it to work. I will report my registry settings and results as per the above posts. I hope some of this information will serve useful to others. |
Thank you for your extraordinarily detailed explanation. That makes perfect sense for lots of things I had never thought of. And I noticed one thing in Chrome recently: When you apply a CSS opacity filter to the element, say So, you could apply a user css of PS: only opacity filter does the trick, opacity property doesn't. But |
Hence, a stylus style like this does the thing:
Important notice: this filter must be applied to the |
OMG I never even considered "exploiting" this compositing limitation. You're both genius!! |
Thank you for the tip, @snowie2000. Besides the Chrome, there are still quite a few applications that utilize the rendering engine. {
"disableLcdText": true
} For MS Edge, which can not be launched via shortcut links typically, I am still relying on the registry |
The only things left untouchable on my computer are the Console (or conhost.exe) and the outer frame of DingTalk (#886). |
I had installed the new release 2025.1.17 and put the following lines in MacType.ini. [Experimental@msedge.exe]
ArmBreaker=2
[Experimental@vivaldi.exe]
ArmBreaker=2 Now both MS Edge and Vivaldi could be rendered beautifully. |
I am using gray-scale anti-alias mode with MacType, which works on most applications. But on Edge, Chrome and other Chromium-based browsers., the setting is not applied.
Those browsers use sub-pixel rendering despite of the setting.
Other settings such as hinting appear to be working--I verified that by using an image processor to XOR pixels from two screenshots taken before and after MacType was enabled.
Screenshot with MacType on (enlarged by 400%)

Screenshot with MacType off (enlarged by 400%)

XOR result of content part in the browser (enlarged by 400%)

ini file:
DeepGrayNoHinting.zip
The text was updated successfully, but these errors were encountered: