Subpixel font smoothing works only in Winecfg

Questions about Wine on Linux
Locked
Quppa
Level 1
Level 1
Posts: 5
Joined: Sun Feb 19, 2017 12:41 am

Subpixel font smoothing works only in Winecfg

Post by Quppa »

Environment:
Distro: Fedora 25
Kernel: 4.9.9
DE: KDE 5.8.5
fontconfig settings:
  • antialias: true
  • hinting: true
  • hintstyle: hintslight
  • rgba: rgb
  • lcdfilter: lcddefault
KDE fonts settings ('Use anti-aliasing'): System Settings

I'm seemingly unable to get subpixel font smoothing working in any application running under Wine with the exception of winecfg. I've tried all the built-in applications like Wine's regedit as well as programs like foobar2000, Mp3tag and Rufus. For every program except Winecfg, there's a mixture of no font smoothing and grayscale font smoothing.

Fiddling with the registry values that Winetricks uses (FontSmoothing, FontSmoothingType, FontSmoothingOrientation, FontSmoothingGamma) doesn't seem to change anything. Winecfg uses subpixel smoothing even if I set FontSmoothingType to 1, and all other programs use grayscale or no smoothing even when FontSmoothingType is set to 2.

GTK and Qt applications both render with subpixel smoothing.

Any ideas on what I can do to make this work? And why Winecfg should respect the system settings when other applications don't?
Attachments
2017-02-19 Subpixel Font Smoothing.png
Quppa
Level 1
Level 1
Posts: 5
Joined: Sun Feb 19, 2017 12:41 am

Re: Subpixel font smoothing works only in Winecfg

Post by Quppa »

Somehow I failed to mention my Wine version: 2.1-staging.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Subpixel font smoothing works only in Winecfg

Post by Bob Wya »

The Fedora developers don't bother to do decent subpixel font hintering OOTB for standard X applications. The best option is using the infinality font patchset (but that is no-longer supported on Fedora).
Second best is to take advantage of the subpixel hinting - recently added to the stock freetype library.

What freetype library have you installed?
If it's 2.7.1 then you're in luck!! 8)
The standard freetype can be configured to support subpixel font rendering (a basterdised version that's not quite as good as the look of the infinality fonts - IMHO).

I've just recently discussed this on the WineHQ Forums actually... See WineHQ Forums: That problem again : anti-aliasing

See these Arch Linux blog posts: That appeared to work fine (on my Arch Linux install)... If set the FontSmoothingType=2 (in each Wineprefix).
That's not extensively tested - as I'm mainly booted into my Gentoo install (where I've got the full infinality support - as I can choose what versions of packages I install).

I tend to puil in all the Windows TrueType fonts globally - from my Windows partition - otherwise you'll need to make sure you've got the necessary truetype fonts installed - for whatever application you are running under Wine.

Also see WineHQ Useful Registry Keys
e.g.
  • how to override non-installed fonts - with substitute fonts that are available
  • which registry key to look at for the pulled in system fonts - that wine has detected
Bob
Quppa
Level 1
Level 1
Posts: 5
Joined: Sun Feb 19, 2017 12:41 am

Re: Subpixel font smoothing works only in Winecfg

Post by Quppa »

I have freetype 2.6.5 - sadly the freetype 2.7.1 package in the Fedora repository only targets the pre-release Fedora 26 at this stage. I don't mind waiting a few more months.

I've imported all the fonts from my Windows 10 install and tried configure the system to use Segoe UI over Tahoma.

What I'm confused about is why Winecfg should have subpixel font smoothing working when no other application under Wine does. I skimmed the code and it looks like a straightforward Win32 application - I certainly couldn't see any fancy font trickery - so why does it behave differently?
Locked