giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.36k stars 459 forks source link

ClearType's sub-pixel rendering has changed from color to black and white, resulting in fuzzy font display #2226

Closed meijialun closed 1 year ago

meijialun commented 1 year ago

Version, Operative system CherryTree 0.99.54, Win10 x64

Describe the bug Windows ClearType's sub-pixel rendering has changed from color to black and white, resulting in fuzzy font display. And also some Chinese fonts cannot be fully displayed.

To Reproduce Type some text in CherryTree 0.99.51, Windows ClearType's sub-pixel rendering looks ok. Type some text in CherryTree 0.99.54, Windows ClearType's sub-pixel rendering has changed from color to black and white, resulting in fuzzy font display.

Screenshots 51 54

meijialun commented 1 year ago

This problem may have existed in 0.99.52 & 53. So I haven't been able to use the new version, the font looks too bad.

giuspen commented 1 year ago

Can you try to edit C:\Program Files\CherryTree\etc\gtk-3.0\settings.ini (or etc\gtk-3.0\settings.ini if portable) and you should have

[Settings]
gtk-theme-name=win32

Can you try and add gtk-xft-rgba=rgb (from https://docs.gtk.org/gtk4/property.Settings.gtk-xft-rgba.html - you can try any of none, rgb, bgr, vrgb, vbgr) I'm honestly ignorant in this matter but I suspect it may be just a default GTK3 setting that changed

meijialun commented 1 year ago

Thanks, but it seems not working, it's still gray scale. Maybe it needs to recompile the entire project? Snipaste_2023-02-23_14-46-29

meijialun commented 1 year ago

I used your README.md method to recompile Cherrytree in Windows with MSYS2, and did not add gtk-xft-rgba=rgb configuration, the run result is OK (rgb sub-pixel rendering) But when I use my compiled cherrytree.exe to replace with cherrytree_0.99.54_win64_portable inside, it does not work (grayscale sub-pixel rendering) This is too strange, there may be a problem with one of the lib components

giuspen commented 1 year ago

That's interesting. Since you can successfully build yourself, maybe you can also try to create the portable folder yourself too, under the folder scripts it starts with msys2_...sh and generates a portable folder from your files to your Desktop. The issue is not with the .exe but with one of the other files copied (or wrongly not copied) from the msys2 installation into the portable folder bundle (which is the same that the installer puts in Program Files)

giuspen commented 1 year ago

Can you test https://drive.google.com/file/d/1JtGXtxgykVMYZZftTLQOf5ov-k3k_FNj/view?usp=share_link and tell me if the bug is still there?

meijialun commented 1 year ago

I'm sorry but Google service is not accessible in China. If you mean to run msys2_prepare_standalone.sh I have tried but failed like this. Snipaste_2023-02-27_10-13-38 Snipaste_2023-02-27_10-04-41 Is there some encoding problem with this folder? Snipaste_2023-02-27_10-07-31

giuspen commented 1 year ago

I will try to upload the package somewhere else and get back. I shall have a look also at the failing test.

giuspen commented 1 year ago

Do you have access to https://www.giuspen.net/software/cherrytree_0.99.54.99_win64_portable.7z ?

meijialun commented 1 year ago

Yes, I can. It's great, ClearType is rgb style in 0.99.54.99_win64_portable.7z now. Thanks. #2171 is also fixed now.

giuspen commented 1 year ago

Excellent, thank you for testing, it was an issue with a library recently fixed in msys2

giuspen commented 1 year ago

fixed in upcoming 0.99.55