0

I have the opposite problem of this: Font smoothing in Wine

Fonts that are rendered the Windows way look blurry and have their colours offset, like on Windows, so I want to disable font smoothing completely.

What I've tried:

  • Regedit keys ClientSideAntiAliasWithRender and ClientSideAntiAliasWithCore in HKCU/Software/Wine/X11 Driver
  • fontsmooth=disable in winetricks
  • Font substitution from this answer, both with a Linux font and a Windows font
  • tested wineboot and real reboot on all of these attempts

Results: None. Both the menus in Notepad++ and the text in Wordpad are still blurry and look exactly the same as before.

I'm using Wine 5.8 on Manjaro 20.0.1.

1 Answers1

0

Wine apparently respects the system's font smoothing setting, no matter what is set anywhere else. This setting is for example located in "Look and feel"→"Appearance"→"Fonts"→"Rendering"→"Details"→"Smoothing" in the settings of my system (Manjaro, Mate desktop environment).

The good news is that Wine does not update font smoothing of a program while it is running. Therefore it's possible to disable font smoothing, start the program to run with Wine and enable font smoothing again, with no effects on the rest of the system.
The bad news is that the way to do this depends on the desktop environment (and probably also distribution), so this answer can only cover very few of them.

An example script for Mate is this:

gsettings set org.mate.font-rendering antialiasing 'none'
env WINEPREFIX="/home/fabian/.wine" wine C:\\windows\\command\\start.exe /Unix /home/fabian/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/Notepad++.lnk "$1"
sleep 1
gsettings set org.mate.font-rendering antialiasing 'rgba'

The second command is just the start command for Notepad++, like it gets auto-generated in the main menu when installing Notepad++ using pacman, except that I added »"$1"« so that it can be used to open files from a file manager. This seems to also work with multiple files.
If I remember correctly, using »"$@"« or »$@« caused some kind of issue, so I'm leaving it like this for now.

A script for more general use, which first reads the setting and later restores it how it was, is this:

antialiasing=`gsettings get org.mate.font-rendering antialiasing`
gsettings set org.mate.font-rendering antialiasing 'none'
# insert your Wine command here
sleep 1
gsettings set org.mate.font-rendering antialiasing $antialiasing

An example script for KDE is this:

xrdb -load /home/fabian/misc/antiantialiasing.bak
cd /home/fabian
env WINEPREFIX="/home/fabian/.wine" wine C:\\windows\\command\\start.exe /Unix /home/fabian/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/Notepad++.lnk "$1"
sleep 1
xrdb -load /home/fabian/misc/antialiasing.bak

Here antialiasing.bak is just a text file containing »Xft.antialias: 1« and antiantialiasing.bak is a text file containing »Xft.antialias: 0«.

This method would probably also work like this or similar in Mate, but I haven't tested it and the gsettings method seems more clean/intended. I have not found such a method for KDE yet.