snowie2000 / mactype

Better font rendering for Windows.
https://mactype.net
GNU General Public License v3.0
9.9k stars 439 forks source link

Support screen rotation #372

Open CwavGuy opened 6 years ago

CwavGuy commented 6 years ago

Hi! I love Mactype with wonderful Anti-Alias effects, especially the LCD(RGB) and LCD(GBR) on my Windows laptop's screen. However, I have some questions when I am using.

Windows laptops were frequently rotated to cope with different situations. However, when I am using Mactype, I found that the Anti-Alias Mode could not change and optimize with its suitable monitor direction automatically. It caused that the displaying text on my device are always dispersion if I forgot to switch the suitable profile and it is really confusing. I hope it can be switched by itself. For example, use LCD(RGB) when forwarding and use LCD(GBR) when reversing.

In addition, Mactype has not provided me options to optimize Anti-Alias Mode for turning right and turning left the monitor. It is also quite necessary.

Thanks.

snowie2000 commented 6 years ago

I looked into the problem and found that it is possible to detect screen rotation, but it requires a handle and message loop to do so. As you know, MacType doesn't run that way. Hence MacType can't detect screen rotation by itself, MacTray or other helper processes are required if this feature is implemented in the future.

sammilucia commented 6 years ago

Hmm, this seems like a huge thing to implement, especially users might want to change LCD to greyscale rendering when the screen is rotated 90 degrees...

snowie2000 commented 5 years ago

@sammilucia Frankly speaking, I don't think it's something that easy to accomplish for the next version. Screen rotation is actually very easy to detect for normal applications, but MacType is very different that there is no message loop or windows controlled with it. So no notification can be received from its side. And I can't do polling every few seconds either, that could be a waste of CPU time that a lot of users will complain about.

sammilucia commented 5 years ago

@snowie2000 yeah I know. You can assign an event handler to _win32_WM_DISPLAYCHANGE then analyse width & height when the event is triggered? ... but then how do you update the open windows?

snowie2000 commented 5 years ago

@sammilucia To receive a WM_DISPLAYCHANGE message, you need a window and a message loop, and MacType has none. Updating existing windows is not very hard, I can enumerate all the windows belong to the process, and enforce a repaint.

sammilucia commented 5 years ago

@snowie2000 ah yes ... make a top level window that never gets displayed? example code http://www.cplusplus.com/forum/windows/23180/