You are not logged in.

#1 2017-11-27 18:40:17

chowbok
Member
Registered: 2017-11-27
Posts: 20

Enabling RGB sub-pixel rendering on a per-application basis

Fonts in my Wine applications look sub-par unless I enable RGB sub-pixel rendering on my system (and yes, I've tried various suggestions about fixing Wine fonts, like enabling smoothing in the Wine config and changing my truetype interpreter in FREETYPE_PROPERTIES. Nothing works except the RGB setting). The problem is that I don't really care for how this makes my fonts look in my other applications, especially my terminal program. So is there some way I can set it so that the RGB subpixel rendering is only enabled for Wine?

Offline

#2 2017-11-27 21:46:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,118

Re: Enabling RGB sub-pixel rendering on a per-application basis

man fonts-conf

       FONTCONFIG_FILE is used to override the default configuration file.

       FONTCONFIG_PATH is used to override the default configuration directory.

If you can separate the fonts, you could match/edit the family you use in the wine client.

Offline

#3 2017-11-27 22:11:08

chowbok
Member
Registered: 2017-11-27
Posts: 20

Re: Enabling RGB sub-pixel rendering on a per-application basis

Sorry, but I'm not sure how that helps me. What does fonts-conf have to do with RGB sub-pixel rendering? That's a video setting.

Offline

#4 2017-11-27 22:13:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,118

Re: Enabling RGB sub-pixel rendering on a per-application basis

That's a video setting.

No.

Offline

#5 2017-11-27 22:14:03

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Enabling RGB sub-pixel rendering on a per-application basis

No it isn't.

RGB sub-pixel rendering is all about font appearance.
https://en.wikipedia.org/wiki/Subpixel_rendering


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2017-11-27 22:43:05

chowbok
Member
Registered: 2017-11-27
Posts: 20

Re: Enabling RGB sub-pixel rendering on a per-application basis

Ah, okay. Sorry for the confusion, then. But still, this only lets me set it on a per-font basis, correct? I'm not even sure what fonts the wine apps are using. There's no way to do it for a particular app?

Offline

#7 2017-11-27 23:33:43

loqs
Member
Registered: 2014-03-06
Posts: 19,097

Re: Enabling RGB sub-pixel rendering on a per-application basis

You specify a seperate FONTCONFIG_PATH for each application then font configuration could contain a snippet that matches all fonts but applies the RGB sub-pixel rendering you desire.

Offline

#8 2017-11-28 01:40:49

chowbok
Member
Registered: 2017-11-27
Posts: 20

Re: Enabling RGB sub-pixel rendering on a per-application basis

That makes sense. But now I can't figure out what exactly to put in the fontconfig file. The example at https://wiki.archlinux.org/index.php/Fo … _rendering isn't doing it for me. The way I normally turn it on is through the XFCE control panel; I'm not sure what exactly it's doing or how to translate it.

Offline

#9 2017-11-28 07:56:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,118

Re: Enabling RGB sub-pixel rendering on a per-application basis

We didn't figure what xfce does, https://bbs.archlinux.org/viewtopic.php?id=231437
But the rgba values are documented in the fonts-conf manpage (and I guess xfce lists the constants by some sensible name in its config?)

Offline

#10 2017-11-28 09:15:36

chowbok
Member
Registered: 2017-11-27
Posts: 20

Re: Enabling RGB sub-pixel rendering on a per-application basis

Okay, so XFCE sets the font stuff systemwide through xfsettingsd. I can query the current settings (awkwardly) with xfconf-query:

> xfconf-query -l -c xsettings|grep Xft
/Xft/Antialias
/Xft/DPI
/Xft/Hinting
/Xft/HintStyle
/Xft/RGBA
> xfconf-query -p /Xft/Antialias -c xsettings
1
> xfconf-query -p /Xft/DPI -c xsettings
96
> xfconf-query -p /Xft/Hinting -c xsettings
1
> xfconf-query -p /Xft/HintStyle -c xsettings
hintfull
> xfconf-query -p /Xft/RGBA -c xsettings
rgb

So guessing at the fontconfig equivalent, I came up with this:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
	<match target="font">
		<edit name="rgba" mode="assign">
			<const>rgb</const>
    		</edit>
    		<edit name="antialias" mode="assign">
			<bool>1</bool>
		</edit>
    		<edit name="hinting" mode="assign">
			<bool>1</bool>
		</edit>
		<edit name="hintstyle" mode="assign">
			<int>3</int>
		</edit>
		<edit name="dpi" mode="assign">
			<double>96</double>
		</edit>
	</match>
</fontconfig>

But it doesn't produce the same results, doggone it. I'm pretty stumped. Did the XFCE people come up with a better way to antialias fonts than the freetype people? Or (more likely) am I just screwing up the fontconfig?

Offline

#11 2017-11-28 12:51:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,118

Re: Enabling RGB sub-pixel rendering on a per-application basis

xfconf-query -l -c xsettings|grep Xft

Those are xft settings which would be altered by xrdb, see https://wiki.archlinux.org/index.php/Fo … ig_support
This would also imply that wine, despite depending on it, doesn't actually use fontconfig (and it doesn't link libfontconfig itself, so unless there's a dlopen that's actually the case)

Pretty dated, but https://www.winehq.org/pipermail/wine-b … 37560.html suggests that wine just prefers xft over fontconfig and in that case the sheer presence o fthe xft settings, put there by xfce, nukes everything you do with fontconfig.

Offline

Board footer

Powered by FluxBB