Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

[SOLVED]Subpixel font rendering with GTK.

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
waterlaz
n00b
n00b
Posts: 5
Joined: Sat Feb 22, 2025 6:11 pm

[SOLVED]Subpixel font rendering with GTK.

  • Quote

Post by waterlaz » Tue Dec 02, 2025 3:05 pm

I believe my QT applications work fine. In GTK-3 I can't seem to make subpixel rendering to work.
My package versions:

Code: Select all

x11-libs/gtk+   3.24.51
x11-libs/cairo  1.18.4-r1
media-libs/freetype 2.14.1-r1
media-libs/fontconfig 2.17.1

I have no local font configuration (no ~/.config/fontconfig/fonts.conf file) and nothing in ~/.config/gtk-3.0.
I believe I have made all the correct settings via fontconfig:

Code: Select all

# eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   05-reset-dirs-sample.conf
  [2]   09-autohint-if-no-hinting.conf
  [3]   09-texlive.conf
  [4]   10-autohint.conf
  [5]   10-hinting-full.conf
  [6]   10-hinting-medium.conf
  [7]   10-hinting-none.conf
  [8]   10-hinting-slight.conf *
  [9]   10-no-antialias.conf
  [10]  10-scale-bitmap-fonts.conf *
  [11]  10-sub-pixel-bgr.conf
  [12]  10-sub-pixel-none.conf
  [13]  10-sub-pixel-rgb.conf *
  [14]  10-sub-pixel-vbgr.conf
  [15]  10-sub-pixel-vrgb.conf
  [16]  10-unhinted.conf
  [17]  10-yes-antialias.conf *
  [18]  11-lcdfilter-default.conf *
  [19]  11-lcdfilter-legacy.conf
  [20]  11-lcdfilter-light.conf
  [21]  11-lcdfilter-none.conf
  [22]  20-unhint-small-dejavu-sans-mono.conf
  [23]  20-unhint-small-dejavu-sans.conf
  [24]  20-unhint-small-dejavu-serif.conf
  [25]  20-unhint-small-vera.conf *
  [26]  25-unhint-nonlatin.conf
  [27]  30-metric-aliases.conf *
  [28]  35-lang-normalize.conf
  [29]  40-nonlatin.conf *
  [30]  45-generic.conf *
  [31]  45-latin.conf *
  [32]  48-guessfamily.conf
  [33]  48-spacing.conf *
  [34]  49-sansserif.conf *
  [35]  50-user.conf *
  [36]  51-local.conf *
  [37]  57-dejavu-sans-mono.conf
  [38]  57-dejavu-sans.conf
  [39]  57-dejavu-serif.conf
  [40]  60-generic.conf *
  [41]  60-latin.conf *
  [42]  60-liberation.conf
  [43]  61-urw-bookman.conf
  [44]  61-urw-c059.conf
  [45]  61-urw-d050000l.conf
  [46]  61-urw-fallback-backwards.conf
  [47]  61-urw-fallback-generics.conf
  [48]  61-urw-fallback-specifics.conf
  [49]  61-urw-gothic.conf
  [50]  61-urw-nimbus-mono-ps.conf
  [51]  61-urw-nimbus-roman.conf
  [52]  61-urw-nimbus-sans.conf
  [53]  61-urw-p052.conf
  [54]  61-urw-standard-symbols-ps.conf
  [55]  61-urw-z003.conf
  [56]  65-fonts-persian.conf *
  [57]  65-khmer.conf
  [58]  65-nonlatin.conf *
  [59]  69-unifont.conf *
  [60]  70-no-bitmaps-and-emoji.conf
  [61]  70-no-bitmaps-except-emoji.conf
  [62]  70-no-bitmaps.conf
  [63]  70-yes-bitmaps.conf
  [64]  75-yes-terminus.conf
  [65]  80-delicious.conf *
  [66]  90-synthetic.conf *
Yet GTK3 renders fonts with only grayscale antialiasing.

I was told that fc-match can print usefull fontconfig info, so here it is:

Code: Select all

$ fc-match --verbose Sans
Pattern has 43 elts (size 48)
	family: "Liberation Sans"(w)
	familylang: "en"(s)
	style: "Regular"(s)
	stylelang: "en"(s)
	fullname: "Liberation Sans"(w)
	fullnamelang: "en"(s)
	slant: 0(i)(s)
	weight: 80(f)(s)
	width: 100(f)(s)
	size: 12(f)(s)
	pixelsize: 12.5(f)(s)
	foundry: "1ASC"(s)
	antialias: True(w)
	hintstyle: 1(i)(w)
	hinting: True(s)
	verticallayout: False(s)
	autohint: False(s)
	globaladvance: True(s)
	file: "/usr/share/fonts/liberation-fonts/LiberationSans-Regular.ttf"(s)
	index: 0(i)(w)
	outline: True(s)
	scalable: True(s)
	dpi: 75(f)(s)
	rgba: 1(i)(w)
	scale: 1(f)(s)
	charset:
	0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
	0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	0002: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	0003: ffffffff ffffffff ffffffff 7c30ffff ffffd7f0 fffffffb ffff7fff ffffffff
	0004: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	0005: 3c0fffff 00000000 00000000 00000000 fffe0000 ffffffff ffff00ff 001f07ff
	001d: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 000007ff c0000000
	001e: ffffffff ffffffff ffffffff ffffffff 4fffffff ffffffff ffffffff 03ffffff
	001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
	0020: fffdffff 561dfc47 40000010 83f0fc00 001f03ff 803fffff 00000000 00010000
	0021: 00c80020 00004044 78186000 00000000 003f0010 00000100 00100000 00000000
	0022: c6268044 00000a00 00000100 00000037 00000000 00000000 00000000 00000000
	0023: 00010004 00000003 00000000 00000000 00000000 00000000 00000000 00000000
	0025: 11111005 10101010 ffff0000 00001fff 000f1111 14041c03 03ff9c10 00000040
	0026: 00000000 9c000000 000000ff 00009e69 00000000 00000000 00000000 00000000
	002c: 00000000 00000000 00000000 00fe3fff 00000000 00000000 00000000 00000000
	002e: 00800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	00a7: ff800000 00000003 00000000 00000000 00001f00 00000000 00000000 00000000
	00fb: e0000006 5f7fffff 0000ffdb 00000000 00000000 00000000 00000000 00000000
	00fe: 00000000 0000000f 00000000 00000000 00000000 00000000 00000000 00000000
	00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10000000
(s)
	lang: aa|ab|af|ast|av|ay|az-az|ba|bm|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|ff|fur|fy|ga|gd|gl|gn|gv|ha|haw|he|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|ku-am|kum|kv|kw|ky|la|lb|lez|ln|lt|lv|mg|mh|mi|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|sco|se|sel|sh|shs|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|to|tr|ts|tt|tw|tyv|uk|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu|ak|an|ber-dz|crh|csb|ee|fat|fil|hsb|ht|hz|jv|kab|kj|kr|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|qu|quz|rn|rw|sc|sg|sn|su|ty|za|agr|ayc|bem|dsb|lij|mfe|mhr|miq|mjw|nhn|niu|rif|sgs|szl|tpi|unm|wae|yuw(s)
	fontversion: 137625(i)(s)
	capability: "otlayout:DFLT otlayout:bopo otlayout:copt otlayout:cyrl otlayout:grek otlayout:hebr otlayout:latn"(w)
	fontformat: "TrueType"(s)
	embeddedbitmap: True(s)
	decorative: False(s)
	lcdfilter: 1(i)(w)
	namelang: "en"(s)
	prgname: "fc-match"(s)
	postscriptname: "LiberationSans"(s)
	color: False(s)
	symbol: False(s)
	variable: False(s)
	fonthashint: True(s)
	order: 0(i)(s)
	namedinstance: False(s)
	fontwrapper: "SFNT"(s)
I have tried debugging the cairo library itself, but so far got nowhere, except for confirming that it does set the grayscale antialiasing mode. No idea, why.
Last edited by waterlaz on Tue Dec 02, 2025 5:34 pm, edited 1 time in total.
Top
waterlaz
n00b
n00b
Posts: 5
Joined: Sat Feb 22, 2025 6:11 pm

  • Quote

Post by waterlaz » Tue Dec 02, 2025 5:34 pm

Ok, After a couple of hours of debugging cairo, it turns out the problem was in gtk
putting the rgb setting in ~/.config/gtk-3.0/settings.ini solved it:

Code: Select all

[Settings]
gtk-xft-rgba = rgb
Top
waterlaz
n00b
n00b
Posts: 5
Joined: Sat Feb 22, 2025 6:11 pm

  • Quote

Post by waterlaz » Thu Dec 04, 2025 10:45 am

In my opinion this is a bug in GTK3. It uses cairo to render fonts and should rely on its decision (cairo respects the fontconfig settings) to use sub-pixel rendering.
Since I couldn't find this info anywhere on the internet, I've updated the Gentoo Wiki on this topic: https://wiki.gentoo.org/wiki/Fontconfig ... _rendering
Top
Post Reply

3 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic