Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634560 - Blurry (unsharp) font rendering fontconfig/freetype Gnome/Firefox Bitstream Vera Sans
Summary: Blurry (unsharp) font rendering fontconfig/freetype Gnome/Firefox Bitstream V...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-17 17:48 UTC by Markus Goppelt
Modified: 2017-10-30 15:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
anti-aliasing turned off (AA_off.png,81.99 KB, image/png)
2017-10-17 17:50 UTC, Markus Goppelt
Details
anti-aliasing turned on (AA_on.png,188.36 KB, image/png)
2017-10-17 17:50 UTC, Markus Goppelt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Goppelt 2017-10-17 17:48:34 UTC
Hello,

I was always a very happy user of Gnome and the font Bitstream Vera Sans. I always used "Hinting - Medium" and "Antialiasing - Grayscale" in the Tweak Tool. I suspect font rendering now gets handled differently (fontconfig). I experimented a bit with the settings in "/etc/fonts/local.conf":

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>

<!-- -->
	<match target="font">
		<edit name="autohint" mode="assign">
			<bool>false</bool>
		</edit>
	</match>

<!-- -->
        <match target="font">
                <edit name="rgba" mode="assign">
			<const>rgb</const>
		</edit>
        </match>

<!-- -->
	<match target="font">
		<edit name="antialias" mode="assign">
			<bool>true</bool>
		</edit>
	</match>

<!-- -->
	<match target="font">
		<edit name="hinting" mode="assign">
			<bool>true</bool>
		</edit>
		<edit name="hintstyle" mode="assign">
			<const>hintmedium</const>
		</edit>
	</match>

<!-- -->
	<match target="font">
 		<edit name="lcdfilter" mode="assign">
 			<const>lcdlegacy</const>
		</edit>
	</match>

</fontconfig>

I am very unhappy with the "antialias" algorithm. I made 2 screenshots:

AA_off
Screenshot Firefox with anti-aliasing turned off (pixely but not blurry)

AA_on
Screenshot Firefox with anti-aliasing turned on (blurry)

Font rendering gets much more smooth, but also quite blurry (unsharp). In the past (font rendering controlled by Gnome) with "Hinting - Medium" and "Antialiasing - Grayscale" I never had such problems.

Can I do something else besides turning off anti-aliasing?
Can the anti-aliasing "strength" be adjusted or something like that?
Can I go back to the old font rendering via Gnome?

I bought my monitor (Eizo S2433W) 2010. It has S-PVA technology. Maybe I get better results with a more modern monitor?

markus@fx ~ $ xdpyinfo | grep dimensions
  dimensions:    1920x1200 pixels (508x317 millimeters)
markus@fx ~ $ xdpyinfo | grep resol
  resolution:    96x96 dots per inch

Everything correct here. The values match the values from the monitor data sheet.

Regards,

Markus
Comment 1 Markus Goppelt 2017-10-17 17:50:07 UTC
Created attachment 499012 [details]
anti-aliasing turned off
Comment 2 Markus Goppelt 2017-10-17 17:50:35 UTC
Created attachment 499014 [details]
anti-aliasing turned on
Comment 3 Markus Goppelt 2017-10-17 18:15:09 UTC
markus@fx ~ $ emerge --info
Portage 2.3.8 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop/gnome, gcc-5.4.0, glibc-2.23-r4, 4.9.34-gentoo x86_64)
=================================================================
System uname: Linux-4.9.34-gentoo-x86_64-AMD_FX-8370E_Eight-Core_Processor-with-gentoo-2.4.1
KiB Mem:    16313624 total,  13214040 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Fri, 13 Oct 2017 20:30:01 +0000
Head commit of repository gentoo: 612f0aac39ab3f2e937e86e9702f5a59b7a6de84
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.32.1::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/chromium/policies/managed/chrome-gnome-shell.json /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/opt/chrome/policies/managed/chrome-gnome-shell.json /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv introspection ipv6 jpeg lcms ldap libnotify libsecret mad mng modules mp3 mp4 mpeg multilib nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio python qt3support qt4 readline sdl seccomp session spell ssl svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vala vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Markus Goppelt 2017-10-17 18:17:16 UTC
I emerged freetype with "-cleartype_hinting":

markus@fx ~ $ equery uses freetype
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/freetype-2.8:
 U I
 + + X                 : Add support for X11
 + + abi_x86_32        : 32-bit (x86) libraries
 + + adobe-cff         : Use Adobe CFF as default font-renderer
 - - bindist           : Disable ClearType support (see
                         http://freetype.org/patents.html)
 + + bzip2             : Support bzip2 compressed PCF fonts.
 - - cleartype_hinting : New bytecode hinting mode for TrueType fonts that
                         activates subpixel hinting (a.k.a. ClearType hinting)
                         by default
 - - debug             : Enable extra debug codepaths, like asserts and extra
                         output. If you want to get meaningful backtraces see h
                         ttps://wiki.gentoo.org/wiki/Project:Quality_Assurance/
                         Backtraces
 - - doc               : Add extra documentation (API, Javadoc, etc). It is
                         recommended to enable per package instead of globally
 - - fontforge         : Install internal headers required for TrueType
                         debugger in media-gfx/fontforge (built with
                         USE=truetype-debugger)
 - - harfbuzz          : Use media-libs/harfbuzz for auto-hinting OpenType
                         fonts. WARNING: may trigger circular dependencies!
 - - infinality        : Enable infinality options for improved LCD filtering
 + + png               : Add support for libpng (PNG images)
 - - static-libs       : Build static versions of dynamic libraries as well
 - - utils             : Install utilities and examples from ft2demos
Comment 5 Markus Goppelt 2017-10-17 18:21:42 UTC
markus@fx ~ $ eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   10-autohint.conf
  [2]   10-hinting-full.conf
  [3]   10-hinting-medium.conf
  [4]   10-hinting-none.conf
  [5]   10-hinting-slight.conf
  [6]   10-no-sub-pixel.conf
  [7]   10-scale-bitmap-fonts.conf *
  [8]   10-sub-pixel-bgr.conf
  [9]   10-sub-pixel-rgb.conf
  [10]  10-sub-pixel-vbgr.conf
  [11]  10-sub-pixel-vrgb.conf
  [12]  10-unhinted.conf
  [13]  11-lcdfilter-default.conf
  [14]  11-lcdfilter-legacy.conf
  [15]  11-lcdfilter-light.conf
  [16]  20-unhint-small-dejavu-sans.conf
  [17]  20-unhint-small-dejavu-sans-mono.conf
  [18]  20-unhint-small-dejavu-serif.conf
  [19]  20-unhint-small-vera.conf
  [20]  25-unhint-nonlatin.conf
  [21]  30-metric-aliases.conf *
  [22]  30-urw-aliases.conf *
  [23]  31-cantarell.conf
  [24]  40-nonlatin.conf *
  [25]  45-latin.conf *
  [26]  49-sansserif.conf *
  [27]  50-user.conf
  [28]  51-local.conf *
  [29]  57-dejavu-sans.conf
  [30]  57-dejavu-sans-mono.conf
  [31]  57-dejavu-serif.conf
  [32]  60-latin.conf *
  [33]  60-liberation.conf
  [34]  65-fonts-persian.conf *
  [35]  65-khmer.conf
  [36]  65-nonlatin.conf *
  [37]  69-unifont.conf *
  [38]  70-no-bitmaps.conf
  [39]  70-yes-bitmaps.conf
  [40]  80-delicious.conf *
  [41]  90-synthetic.conf *
  [42]  99pdftoopvp.conf
Comment 6 Mike Gilbert gentoo-dev 2017-10-29 16:53:34 UTC
I really have no idea how to assign this bug report. The summary mentions 5 different packages/programs.

What changed?
Comment 7 Markus Goppelt 2017-10-30 15:42:54 UTC
(In reply to Mike Gilbert from comment #6)
> I really have no idea how to assign this bug report. The summary mentions 5
> different packages/programs.
> 
> What changed?

As far as I understand "fontconfig" and "freetype" control font rendering. The bug report should be assigned to fontconfig or freetype. But I am not an expert.

The problem is that the font "Bitstream Vera Sans" now gets rendered blurry (unsharp). I think it is due to the anti-aliasing. I haven't experimented much with other fonts, but I think they have the same problem. At least with my hardware (S-PVA LCD monitor).