Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 452860 - media-libs/fontconfig-infinality installs invalid /etc/X11/Xresources
Summary: media-libs/fontconfig-infinality installs invalid /etc/X11/Xresources
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ben de Groot (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-18 18:36 UTC by Robert Cabrera
Modified: 2013-04-05 09:02 UTC (History)
2 users (show)

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


Attachments
fix comments in Xresources (Xresources.patch,3.55 KB, patch)
2013-03-18 13:49 UTC, poncho
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Cabrera 2013-01-18 18:36:38 UTC
I've been running freetype with the infinality patches for some time. Prior to its arrival in the portage tree, I was using the version from the lcd-filtering overlay.

I was troubleshooting another X related issue I was having and noticed my .xsession-errors is being polluted by error messages. The culprit appears to be  /etc/X11/Xresources. Every time I reboot into KDM or log back into KDE from the console the following messages appear:

/etc/X11/Xresources:5:3: error: invalid preprocessing directive #XFT
/etc/X11/Xresources:6:3: error: invalid preprocessing directive #These
/etc/X11/Xresources:7:3: error: invalid preprocessing directive #google
/etc/X11/Xresources:8:3: error: invalid preprocessing directive #crap
/etc/X11/Xresources:9:3: error: invalid preprocessing directive #normally
/etc/X11/Xresources:10:3: error: invalid preprocessing directive #because
/etc/X11/Xresources:11:3: error: invalid preprocessing directive #a
/etc/X11/Xresources:12:3: error: invalid preprocessing directive #autohinter
/etc/X11/Xresources:13:3: error: invalid preprocessing directive #(
/etc/X11/Xresources:14:3: error: invalid preprocessing directive #TT
/etc/X11/Xresources:15:3: error: invalid preprocessing directive #/
/etc/X11/Xresources:16:3: error: invalid preprocessing directive #rendered
/etc/X11/Xresources:17:3: error: invalid preprocessing directive #should
/etc/X11/Xresources:18:3: error: invalid preprocessing directive #that
/etc/X11/Xresources:19:3: error: invalid preprocessing directive #avoid
/etc/X11/Xresources:20:3: error: invalid preprocessing directive #INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING
/etc/X11/Xresources:21:3: error: invalid preprocessing directive #use
/etc/X11/Xresources:22:3: error: invalid preprocessing directive #full
/etc/X11/Xresources:22:30: warning: missing terminating ' character [enabled by default]
/etc/X11/Xresources:23:3: error: invalid preprocessing directive #circumstances
/etc/X11/Xresources:24:3: error: invalid preprocessing directive #good
startkde: Starting up...

The file that's causing this /etc/X11/Xresources reads as follows:

#################################################################
################## EXPLANATION OF SETTINGS ######################
#################################################################

# XFT settings are like a red-headed stepchild that should be beaten severely.
# These only affect legacy programs, and *parts* of some modern programs like
# google-chrome.  We only deal with these settings because we have to, otherwise
# crap will slip by.  I recommend using hintslight and autohint as the defaults
# normally in local.conf.  The reason hintfull and autohint:0 is needed here
# because otherwise some programs will occassionally request slight hinting for
# a truetype font. When a program does this, Freetype automatically uses the
# autohinter, when you may actually want it to be rendered with the TT hinter,
# (if specified in local.conf).  So setting this to hintfull guarantees that the
# TT font will be rendered with the TT hinter (assuming it is specified in
# /etc/fonts/local.conf to be rendered that way.)  For TT fonts that you want
# rendered with autohint, specifiying that in the /etc/fonts/local.conf
# should be enough.  But you might think that by setting this to hintfull
# that it's going to use Freetype's full autohinting (which we *completely*
# avoid) for fonts you want autohinted.  This is where
# INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING comes in.  It tells freetype to
# use slight hinting on fonts set for autohinting, even if the program requests
# full autohinting.  Freetype's full hinting only looks OK under certain
# circumstances.  The goal of infinality is to make infinality hinting look
# good all the time.

Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

I've been using Gentoo for over a decade, but I'm not a programmer, I'm a truck driver and haven't been able to find out on the net what exactly is causing the errors.

Any help would be appreciated.

Reproducible: Always

Steps to Reproduce:
1.startx or startkde
2.
3.
Actual Results:  
above error messages

Expected Results:  
no errors
Comment 1 Robert Cabrera 2013-01-18 18:55:33 UTC
Note: I took a chance on my own and edited out of /etc/X11/Xresources all of the lines that were commented beginning with "#" and all of the errors in .xsession-errors relating to /etc/X11/Xresources are now gone.

My new /etc/X11/Xresources looks like this:

Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

Perhaps the method used for commenting this file is incorrect? As I said, I'm not a programmer, but I'll try on my own commenting using "!" instead of "#" and see if there are errors and report back.
Comment 2 Robert Cabrera 2013-01-18 19:11:23 UTC
OK, I went back and commented /etc/X11/Xresources with "!" instead of "#" and now I only have one error message that I don't understand:

/etc/X11/Xresources:22:31: warning: missing terminating ' character [enabled by default]
startkde: Starting up...

The file now looks like this:

!#################################################################
!################## EXPLANATION OF SETTINGS ######################
!#################################################################

!# XFT settings are like a red-headed stepchild that should be beaten severely.
!# These only affect legacy programs, and *parts* of some modern programs like
!# google-chrome.  We only deal with these settings because we have to, otherwise
!# crap will slip by.  I recommend using hintslight and autohint as the defaults
!# normally in local.conf.  The reason hintfull and autohint:0 is needed here
!# because otherwise some programs will occassionally request slight hinting for
!# a truetype font. When a program does this, Freetype automatically uses the
!# autohinter, when you may actually want it to be rendered with the TT hinter,
!# (if specified in local.conf).  So setting this to hintfull guarantees that the
!# TT font will be rendered with the TT hinter (assuming it is specified in
!# /etc/fonts/local.conf to be rendered that way.)  For TT fonts that you want
!# rendered with autohint, specifiying that in the /etc/fonts/local.conf
!# should be enough.  But you might think that by setting this to hintfull
!# that it's going to use Freetype's full autohinting (which we *completely*
!# avoid) for fonts you want autohinted.  This is where
!# INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING comes in.  It tells freetype to
!# use slight hinting on fonts set for autohinting, even if the program requests
!# full autohinting.  Freetype's full hinting only looks OK under certain
!# circumstances.  The goal of infinality is to make infinality hinting look
!# good all the time.

Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

Again, if I remove all of the comments there are no errors before KDE starts.

Since the infinality patches have been merged into the main Gentoo tree the maintainer(s) should look into this and make a correction(s)

Thanks in advance

Robert
Comment 3 Robert Cabrera 2013-01-18 19:23:32 UTC
Upon further research I've also noticed from the lcd-filtering wiki that the default configuration file for libXft should reside '/usr/share/X11/app-defaults/Xft'. I have no such file, perhaps this is also an issue?
Comment 4 Ben de Groot (RETIRED) gentoo-dev 2013-01-20 09:28:40 UTC
(In reply to comment #2)
> OK, I went back and commented /etc/X11/Xresources with "!" instead of "#"

It seems this is the correct approach.

> and now I only have one error message that I don't understand:
> 
> /etc/X11/Xresources:22:31: warning: missing terminating ' character [enabled
> by default]
> startkde: Starting up...

This is just a warning and is inconsequential.

> Again, if I remove all of the comments there are no errors before KDE starts.

This is probably what I will end up doing to fix this.
Comment 5 Ben de Groot (RETIRED) gentoo-dev 2013-01-20 09:29:11 UTC
(In reply to comment #3)
> Upon further research I've also noticed from the lcd-filtering wiki that the
> default configuration file for libXft should reside
> '/usr/share/X11/app-defaults/Xft'. I have no such file, perhaps this is also
> an issue?

That is from the overlay and doesn't apply to the package in portage.
Comment 6 poncho 2013-03-18 13:49:59 UTC
Created attachment 342530 [details, diff]
fix comments in Xresources
Comment 7 Ben de Groot (RETIRED) gentoo-dev 2013-04-05 09:02:33 UTC
+*fontconfig-infinality-20130404 (05 Apr 2013)
+
+  05 Apr 2013; Ben de Groot <yngwin@gentoo.org>
+  +fontconfig-infinality-20130404.ebuild, files/Xresources:
+  Version bump, thanks to lxnay for rolling the tarball.
+  Fixes bugs #456652 (version bump), #430550 (broken link), #452860 (wrong
+  Xresources syntax), #462924 (multiple values in test warning), and adds
+  a warning about type-1 fonts (#436500). Implements readme.gentoo eclass.
+  Apologies for the delay.