You are not logged in.

#1 2017-06-27 17:09:00

monsieur moche
Member
From: France
Registered: 2009-10-14
Posts: 50

[Solved] Bad font rendering under Gnome 3 (with comparison pics)

Hi Arch users,

I've just reinstalled Arch after a couple of months away, and I can't configure fontconfig properly.

Here are two comparisons pics:
- the first one on Ubuntu https://i.imgur.com/v5B3APX.png
- the second one on Arch https://i.imgur.com/o8xKRQ5.png

The font rendering is much crispier in the first pic. I'd like to achieve that. IIRC, font rendering wasn't that bad on my previous Arch (same PC).

I thought it was only a matter of hinting, but setting it to medium or even full doesn't fix the blurriness.

Here is my fonts.conf:

florian@flobox:~$ cat .config/fontconfig/fonts.conf 
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <match target="font">
        <edit mode="assign" name="rgba">
            <const>none</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hinting">
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="antialias">
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="lcdfilter">
            <const>lcdnone</const>
        </edit>
    </match>
    <dir>~/.fonts</dir>
</fontconfig>

Global conf.d contains these presets:

florian@flobox:~$ ls /etc/fonts/conf.d/
10-hinting-slight.conf                 51-local.conf
20-unhint-small-dejavu-sans.conf       57-dejavu-sans.conf
20-unhint-small-dejavu-sans-mono.conf  57-dejavu-sans-mono.conf
20-unhint-small-dejavu-serif.conf      57-dejavu-serif.conf
20-unhint-small-vera.conf              60-latin.conf
30-metric-aliases.conf                 65-fonts-persian.conf
30-urw-aliases.conf                    65-nonlatin.conf
31-cantarell.conf                      69-gnu-free-fonts.conf
40-nonlatin.conf                       69-unifont.conf
45-latin.conf                          80-delicious.conf
49-sansserif.conf                      90-synthetic.conf
50-user.conf                           README

I don't have a .config/fontconfig/conf.d.

Also, hinting is set to full and antialiasing to grayscale in gnome-tweak-tool.

My video card is a Nvidia GTX 960 and I use proprietary drivers.

Here is my xorg.conf:

florian@flobox:~$ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 367.57  (buildmeister@swio-display-x64-rhel04-13)  Mon Oct  3 21:42:19 PDT 2016

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "nvidia-auto-select +0+0 { ForceCompositionPipeline = On }" #fix tearing
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

My font packages:

florian@flobox:~$ pacman -Qs font
local/cantarell-fonts 1:0.0.25-3
    Cantarell font family
local/fontconfig 2.12.3-1
    A library for configuring and customizing font access
local/fontforge 20161012-4
    Outline and bitmap font editor
local/fontsproto 2.1.3-2
    X11 font extension wire protocol
local/freetype2 2.8-2
    Font rasterization library
local/gnome-font-viewer 3.24.0-1 (gnome)
    A font viewer utility for GNOME
local/gnu-free-fonts 20120503-4
    A free family of scalable outline fonts
local/gsfonts 20160531-3
    URW+ Postscript core35 fonts
local/libfontenc 1.1.3-1
    X11 font encoding library
local/libotf 0.9.13-2
    OpenType Font library
local/libxfont 1.5.2-1
    X11 font rasterisation library
local/libxfont2 2.0.1-1
    X11 font rasterisation library
local/libxft 2.3.2-1
    FreeType-based font drawing library for X
local/noto-fonts 20170428-1
    Google Noto TTF fonts
local/t1lib 5.1.2-6
    Library for generating character- and string-glyphs from Adobe Type 1 fonts
local/ttf-bitstream-vera 1.10-11
    Bitstream Vera fonts.
local/ttf-dejavu 2.37-1
    Font family based on the Bitstream Vera Fonts with a wider range of
    characters
local/ttf-freefont 20120503-4
    Set of free outline fonts covering the Unicode character set
local/ttf-liberation 2.00.1-7
    Red Hats Liberation fonts.
local/ttf-linux-libertine 5.3.0-3
    Serif (Libertine) and Sans Serif (Biolinum) OpenType fonts with large
    Unicode coverage
local/ttf-ms-fonts 2.0-10
    Core TTF Fonts from Microsoft
local/ttf-vista-fonts 1-8
    Microsoft Vista True Type Fonts
local/xorg-bdftopcf 1.0.5-1 (xorg xorg-apps)
    Convert X font from Bitmap Distribution Format to Portable Compiled Format
local/xorg-font-util 1.3.1-1 (xorg-fonts xorg)
    X.Org font utilities
local/xorg-font-utils 7.6-4
    Transitional package depending on xorg font utilities
local/xorg-fonts-100dpi 1.0.3-3 (xorg)
    X.org 100dpi fonts
local/xorg-fonts-75dpi 1.0.3-3 (xorg)
    X.org 75dpi fonts
local/xorg-fonts-alias 1.0.3-1
    X.org font alias files
local/xorg-fonts-encodings 1.0.4-4 (xorg-fonts xorg)
    X.org font encoding files
local/xorg-fonts-misc 1.0.3-5
    X.org misc fonts
local/xorg-mkfontdir 1.0.7-8 (xorg xorg-apps)
    Create an index of X font files in a directory
local/xorg-mkfontscale 1.1.2-1 (xorg-apps xorg)
    Create an index of scalable font files for X

Help me please?

Last edited by monsieur moche (2017-06-28 17:40:04)

Offline

#2 2017-06-27 23:25:41

goumba
Member
From: New Jersey, USA
Registered: 2017-03-31
Posts: 21
Website

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

Mine looked decent until a recent upgrade, then started looking bad. Don't know what files changed.

I used the configuration shown here, and saw a vast improvement. Give it a try:

http://worldofgnome.org/how-to-greatly- … fedora-20/

Last edited by goumba (2017-06-27 23:26:25)


FSF Associate Member #12876
"Yeah, well, you know, that's just, like, your opinion, man." - The Dude

Offline

#3 2017-06-27 23:53:20

mrlamud
Member
Registered: 2014-09-27
Posts: 105

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

Try this.

#~/.config/fontconfig/fonts.conf
......
        <!-- Should be enabled by default -->
        <edit mode="assign" name="antialias">
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle">
            <const>hintslight</const>
        </edit>
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
...

Offline

#4 2017-06-28 02:06:47

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

Are you sure you are using the same font between both operating systems?  Also, I doubt you will ever get it looking exactly the same because I think Ubuntu tweaks the rendering a bit, though that may not be the case anymore.  I know in the past, Ubuntu did indeed tweak the rendering.

Offline

#5 2017-06-28 16:35:54

monsieur moche
Member
From: France
Registered: 2009-10-14
Posts: 50

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

@goumba @mrlamud
Thank you but none of your confs improve the rendering.

@circleface
All I can say is that both systems use the same home directory. I don't see any font redirection in the global fonts.conf of my Ubuntu. Selecting other fonts in gnome-tweak-tool doesn't help anyway.
It's okay if it doesn't look exactly the same. All I want is at least a proper hinting, i.e. that my "l"s are rendered as 1px wide black vertical lines. Surely we can achieve this without using Ubuntu's freetype, right?

Offline

#6 2017-06-28 16:42:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,406

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

Have you tried playing around with the different values in /etc/profile.d/freetype2.sh ? They will also have a noticable impact. (Relog after changing to see your changes and note that you can't combine them, only one of them should be active at a time)

Last edited by V1del (2017-06-28 16:43:10)

Offline

#7 2017-06-28 17:39:43

monsieur moche
Member
From: France
Registered: 2009-10-14
Posts: 50

Re: [Solved] Bad font rendering under Gnome 3 (with comparison pics)

Wow. I've just changed the interpreter version to 35 and the rendering is waaaay better.

florian@flobox:~$ cat /etc/profile.d/freetype2.sh 
# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
# version. The available settings are:
#
#     truetype:interpreter-version=35  # Classic mode (default in 2.6)
#     truetype:interpreter-version=38  # Infinality mode
#     truetype:interpreter-version=40  # Minimal mode (default in 2.7)
#
# There are more properties that can be set, separated by whitespace. Please
# refer to the FreeType documentation for details.

# Uncomment and configure below
export FREETYPE_PROPERTIES="truetype:interpreter-version=35"

There's still some tweaking to do for some fonts (e.g. the one used by Facebook), but otherwise it's just perfect.

Thank you very much V1del smile.

Offline

Board footer

Powered by FluxBB