Bug 232466

Summary: Fonts look really bad - standard fixes don't work
Product: [openSUSE] openSUSE 10.2 Reporter: Oliver Dain <opublic>
Component: X11 ApplicationsAssignee: Mike Fabian <mfabian>
Status: RESOLVED WORKSFORME QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: firefox screen shot
screen shot of the Gimp
shot of Thunerbird menus and toolbar
~/.fonts.conf and /etc/fonts/*
.fonts.conf
firefox screen shot after making suggested changes

Description Oliver Dain 2007-01-08 05:19:52 UTC
The fonts on my machine look horrible (much worse than they did in openSuSE 10.0). I've tried all the "standard" fixes including:

- installing MS TrueType fonts
- changing /etc/fonts/suse-post-user.conf adding aliases from serif/sans serif to good fonts
- adjusted the anti-aliasing settings via kcontrol, ~/.fonts.conf, etc/fonts/suse-post-user.conf, changing BYTECODE_BW_MAX_PIXEL settings via yast's /etc/sysconfig editor (currently set to 18), and tweaking with the nvidia driver settings
- Downgrading and then re-upgrading the nvidia drivers
- changing hinting settings in ~/.fonts.conf and in kcontrol
- following the directions at http://en.opensuse.org/Optimal_Use_of_MS_TrueType_Core_Fonts_for_a_KDE_Desktop_on_SuSE
- a bunch more stuff I can't even remember anymore.

I've attached a bunch of screen shots so you can see what I mean. One strange thing that may provide a hint: the fonts don't look great in the screen shots, but they look a bit better than the actual fonts - in other words, if I grab a screen shot, save it and then open it and compare the image to the actual window I just took a screen shot of, the image looks a bit better than the original (for example the "G" in the eGroupware bookmark in my bookmarks toolbar on my Firefox screen shot looks cleaner than the image on my screen). How can that be?

I'm stumped. Help!!
Comment 1 Oliver Dain 2007-01-08 05:20:32 UTC
Created attachment 111771 [details]
firefox screen shot
Comment 2 Oliver Dain 2007-01-08 05:20:50 UTC
Created attachment 111772 [details]
screen shot of the Gimp
Comment 3 Oliver Dain 2007-01-08 05:21:10 UTC
Created attachment 111773 [details]
shot of Thunerbird menus and toolbar
Comment 4 Mike Fabian 2007-01-08 11:17:30 UTC
The fonts in your Gimp screen shot are not anti-aliased.  There was a
bug which caused GTK2 applications to display without anti-aliasing on
a KDE desktop (bug #193095) but I think this has been fixed before the final
release. Or are you using a beta version or a release candidate?

Comment 5 Mike Fabian 2007-01-08 11:20:03 UTC
Oliver Dain> (for example the "G" in the eGroupware bookmark in my
Oliver Dain> bookmarks toolbar on my Firefox screen shot looks cleaner
Oliver Dain> than the image on my screen).  How can that be?

What program are you using to create the screen shots?

Comment 6 Mike Fabian 2007-01-08 11:29:48 UTC
The fonts in your screen shots for firefox and thunderbird look very blurred,
as if you have turned off hinting.

The opinions of users which style of font rendering varies a lot.

To enable me to help you to get the fontrendering style you want, please
tell me your preferences.

Do you want anti-aliasing?

Or do you prefer the black-and-white rendering of the Microsoft Webfonts which look
like high quality bitmap fonts at small sizes?

You have set BYTECODE_BW_MAX_PIXEL=18, which is supposed to give you
black-and-white rendering of the Microsoft Webfonts. Is this what you
want?  It is not visible in your screen shots.

By the way, you don't need to change anything in /etc/fonts, you can overwrite
any settings from /etc/fonts by editing only ~/.fonts.conf.

It is difficult to for me to tell what is going on on your system because
I cannot know what you have edited.

Therefore, please attach the following information:

- a tarball of /etc/fonts
- your ~/.fonts.conf file
- The output of "xrdb -query | grep Xft"





Comment 7 Oliver Dain 2007-01-08 16:25:02 UTC
I am using the final version:

oliver@astro:~> rpm -q openSUSE-release
openSUSE-release-10.2-35

The screenshots were created with GIMP (file->aquire->screen shot). The fonts do indeed look blurred. That's not an artifact of the way they were captured. Just to verify I've looked at the screen shots I uploaded from another computer and they look correct.

As for font styles I'm afraid I can't be too much help. I don't know enough about the effects of anti-aliasing, hinting, etc. to know what my preferences are. I know that's a bit of a cop-out and I also know that there's an issue of personal preference. However, I think at this point my fonts look bad enough that we can probably agree that they're objectively bad. I don't think anybody would have a preference for fonts that look like this. If we can get them to the point somebody might like them, then I realize it's up to me to experiment with options to figure out what my personal preference are.

I know I don't need to change /etc/fonts, but since things were so screwy I did thinking maybe my ~/.fonts.conf wasn't being picked up or something.

I'll add the requested tarball. The xrdb output you requested is below:

oliver@astro:~> xrdb -query | grep Xft
Xft.antialias:  0
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
Comment 8 Oliver Dain 2007-01-08 16:26:50 UTC
Created attachment 111846 [details]
~/.fonts.conf and /etc/fonts/*
Comment 9 Mike Fabian 2007-01-08 16:51:58 UTC
You are using KDE?
Comment 10 Mike Fabian 2007-01-08 17:06:08 UTC
Oliver Dain> oliver@astro:~> xrdb -query | grep Xft
Oliver Dain> Xft.antialias:  0
Oliver Dain> Xft.hinting:    1
Oliver Dain> Xft.hintstyle:  hintslight
Oliver Dain> Xft.rgba:       rgb

This looks like the problem in bug #193095. Strange, I thought this was
fixed in the final release.


Comment 11 Oliver Dain 2007-01-08 17:11:05 UTC
Yes, I'm a KDE user.
Comment 12 Oliver Dain 2007-01-08 17:12:20 UTC
BTW: Native KDE apps don't look any better. For example, the fonts in konq and kwrite look pretty bad too.
Comment 13 Mike Fabian 2007-01-08 17:19:50 UTC
You made the following changes to suse-post-user.conf:

    diff -ru /etc/fonts/suse-post-user.conf fonts/suse-post-user.conf
    --- /etc/fonts/suse-post-user.conf      2006-12-08 13:50:46.000000000 +0100
    +++ fonts/suse-post-user.conf   2007-01-06 21:29:56.000000000 +0100
    @@ -10,11 +10,11 @@
	    <alias>
		    <family>serif</family>
		    <prefer>
    +                       <family>Bitstream Vera Serif</family>
			    <family>Times New Roman</family>
			    <family>Thorndale AMT</family>
			    <family>DejaVu Serif</family>
			    <family>SUSE Serif</family>
    -                       <family>Bitstream Vera Serif</family>
			    <family>Nimbus Roman No9 L</family>
			    <family>Luxi Serif</family>
			    <family>Likhan</family>
    @@ -48,13 +48,13 @@
	    <alias>
		    <family>sans-serif</family>
		    <prefer>
    +                       <family>Nimbus Sans L</family>
    +                       <family>Bitstream Vera Sans</family>
    +                       <family>Verdana</family>
			    <family>Arial</family>
			    <family>Albany AMT</family>
    -                       <family>Verdana</family>
			    <family>DejaVu Sans</family>
			    <family>SUSE Sans</family>
    -                       <family>Bitstream Vera Sans</family>
    -                       <family>Nimbus Sans L</family>
			    <family>Luxi Sans</family>
			    <family>Mukti Narrow</family>
			    <family>Nachlieli CLM</family>
    @@ -86,8 +86,8 @@
	    <alias>
		    <family>monospace</family>
		    <prefer>
    -                       <family>Consolas</family>
			    <family>Andale Mono</family>
    +                       <family>Consolas</family>
			    <family>DejaVu Sans Mono</family>
			    <family>SUSE Sans Mono</family>
			    <family>Bitstream Vera Sans Mono</family>


1) Moving "Bitstream Vera Serif" to the top positon for "serif"
   is OK, if you prefer that font. But I recommend to use
   "DejaVu Serif" instead. "DejaVu Serif" is based on "Bitstream Vera Serif"
   but has a few more characters.

2) Moving "Nimbus Sans L" to the top of the "sans-serif" list is
   not a good idea if you want to have sharp (non-blurred) fonts.
   "Nimbus Sans L" is a Postscript font. Postscript fonts have no
   byte code and will therefore never render as sharp as TrueType
   fonts with good byte code (Like the Microsoft fonts, the agfa-fonts,
   the Bistream Vera, and the Dejavu Fonts).

3) Removing "Consolas" from the top of the "monospace" list does nothing
   unless you have the fonts from Windows Vista installed.
   "Consolas" comes with Windows Vista. Fonts which don't exist
   on your system are ignored anyway.
Comment 14 Mike Fabian 2007-01-08 17:25:44 UTC
Oliver Dain> Yes, I'm a KDE user.

OK.

Oliver Dain> BTW: Native KDE apps don't look any better. For example,
Oliver Dain> the fonts in konq and kwrite look pretty bad too.

Your Gimp screen shot looks very different from the FireFox and the
Thunderbird screen shot. The reason is that Gimp (as most other
GTK2 applications) uses the Xresources

    Xft.antialias:  0
    Xft.hinting:    1
    Xft.hintstyle:  hintslight
    Xft.rgba:       rgb

which specify very different settings from your ~/.fonts.conf.

Firefox and Thunderbird are GTK2 applications as well, that they
behave differently from Gimp here is probably a bug in Firefox and Thunderbird.
I already reported this as bug #23508.
Comment 15 Mike Fabian 2007-01-08 17:31:35 UTC
Apart from changing the default font, you made no
significant changes to /etc/fonts.
Comment 16 Mike Fabian 2007-01-08 17:52:22 UTC
Created attachment 111868 [details]
.fonts.conf

Please revert your changes in /etc/fonts (the easiest way to do that
is to install the fontconfig package again).

Then please try the attached ~/.fonts.conf file.
Comment 17 Mike Fabian 2007-01-08 17:55:49 UTC
And please add the following lines to your ~/.Xdefaults file:

    Xft.antialias:  1
    Xft.hinting:    1
    Xft.hintstyle:  hintfull
    Xft.rgba:       rgb

If you don't yet have a file ~/.Xdefaults, create one.

This is to make the settings used by GTK2 programs which are
influenced by these X-resource (e.g. Gimp, Gedit, ...) the same
as for other programs which don't use the X-resouces
(Firefox, Thunderbird, KDE applications, ...).

Comment 18 Mike Fabian 2007-01-08 17:58:27 UTC
The above settings in ~/.fonts.conf and ~/.Xdefaults should give you
rendering with anti-aliasing which is very sharp (very little gray
used to smooth the glyphs). Please check with "xmag"!

You can try wether you prefer the Microsoft fonts over the DejaVu fonts
be reverting the lines in the preferences, i.e.:

<alias>
	<family>serif</family>
	<prefer>
		<family>Times New Roman</family>
		<family>DejaVu Serif</family>
	</prefer>
</alias>

<alias>
	<family>sans-serif</family>
	<prefer>
		<family>Verdana</family>
		<family>DejaVu Sans</family>
	</prefer>
</alias>

<alias>
	<family>monospace</family>
	<prefer>
		<family>Andale Mono</family>
		<family>DejaVu Sans Mono</family>
	</prefer>
</alias>
Comment 19 Mike Fabian 2007-01-08 18:06:55 UTC
If you still think the fonts are too blurry after doing what I
suggested in the comments #16, #17, and #18, please edit the rule to
switch off anti-aliasing for the Microsoft Webfonts and the agfa-fonts
to use a size > 0, e.g. 18. I.e. the rule should look like this after
editing:

<match target="font">
        <test name="family">
                <string>Andale Mono</string>
                <string>Arial</string>
                <string>Comic Sans MS</string>
                <string>Georgia</string>
                <string>Impact</string>
                <string>Trebuchet MS</string>
                <string>Verdana</string>
                <string>Courier New</string>
                <string>Times New Roman</string>
                <string>Tahoma</string>
                <string>Webdings</string>
                <string>Albany AMT</string>
                <string>Thorndale AMT</string>
                <string>Cumberland AMT</string>
                <string>Andale Sans</string>
                <string>Andy MT</string>
                <string>Bell MT</string>
                <string>Monotype Sorts</string>
        </test>
	<test name="pixelsize" compare="less_eq">
			<double>18</double>
	</test>
        <edit name="autohint">
                <bool>false</bool>
        </edit>
        <edit name="antialias">
                <bool>false</bool>
        </edit>
</match>

And move the Microsoft Webfonts to the top of the preference lists as
written in comment #18, this black and white rendering works well only
with the Microsoft Webfonts and the agfa-fonts.

This will give you even sharper rendering for the Microsoft Webfonts
and the agfa-fonts: No gray at all, they will look like high-quality
bitmap fonts then. Some people like it, some don't.

And, to make this work also for GTK2 applications, use

    Xft.antialias:  0
    Xft.hinting:    1
    Xft.hintstyle:  hintfull
    Xft.rgba:       rgb

in your ~/.Xdefaults.

Unfortunately you can neither set a size limit in ~/.Xdefaults for
switching off the anti-aliasing nor limit the effect to certain fonts.

I.e. when swiching off anti-aliasing in ~/.Xdefaults, GTK2
applications will always use black and white rendering no matter what
font and what size is used.

This isn't a very serious problem, above 18 pixel most fonts render
reasonably well even without anti-aliasing and if you prefer the
Microsoft fonts in the preference lists in ~/.fonts.conf, you will
rarely see other fonts on you desktop anyway.




Comment 20 Mike Fabian 2007-01-08 18:08:37 UTC
I think the main mistake in your setup was

 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintslight</const>
  </edit>
 </match>

hintslight makes the fonts very blurry. hintfull is much better.

Therefore, hintfull is the default on openSUSE 10.2.

But, believe it or not, some users prefer hintslight.

Comment 21 Oliver Dain 2007-01-08 18:39:57 UTC
Created attachment 111890 [details]
firefox screen shot after making suggested changes

I re-installed fontconfig:

fontconfig-2.4.1-19.x86_64.rpm
fontconfig-32bit-2.4.1-19.x86_64.rpm
fontconfig-devel-2.4.1-19.x86_64.rpm
fontconfig-devel-32bit-2.4.1-19.x86_64.rpm

via rpm -ivh --force fontconfig*

I also added a ~/.Xdefaults with the contents you suggested and used the .fonts.conf file you attached. Sadly, no dice. The attached file show a screenshot of firefox after I applied all these changes, logged out (to restart the Xserver) hit ctrl-alt-backspace (to make extra-double-secret sure the x server restarted) and then logged back in. As you can see, it's still very ugly. 

I'm quite confused!
Comment 22 Oliver Dain 2007-01-08 19:16:39 UTC
I just got to work and looked at the screen shots I submitted on my machine here. They look considerably better here than at home! Indeed, the latest firefox screen shots I submitted look quite good.

I'm not sure what to make of that! The screen shots don't look good at home, nor do the fonts. I'm using the same monitor I was using with SuSE 10.0 and then things looked great. I do have a new computer however - could this all be due to RF interference? I wonder if better video cables would do the trick. I am using DVI cables which I thought were supposed to be relatively robust to noise.

Anyway - it looks like this is maybe not a SuSE thing at all but rather a hardware issue.

Thanks for all your help.
Comment 23 Mike Fabian 2007-01-09 10:44:42 UTC
Oliver Dain> The attached file show a screenshot of firefox after I applied all
Oliver Dain> these changes, logged out (to restart the Xserver) hit
Oliver Dain> ctrl-alt-backspace (to make extra-double-secret sure the x server
Oliver Dain> restarted) and then logged back in. As you can see, it's still very
Oliver Dain> ugly.

This screen shot looks OK to me.
The font in the menus and the URL bar of Firefox is "DejaVu Sans"
(or the identical looking "Bitstream Vera Sans") and the monospace
font in the text of the bug report is "Courier New".

Both fonts look OK to me, I can reproduce identical rendering
results on my openSUSE 10.2 system

 xfd -fa "Courier New:pixelsize=12"
 xfd -fa "DejaVu Sans:pixelsize=11"

when using antialias=true, hinting=true, hintstyle=hintfull, autohint=false
in my ~/.fonts.conf.

I.e. I think there is no problem with the font rendering.
Comment 24 Mike Fabian 2007-01-09 11:28:43 UTC
- Are you using a CRT monitor or an LCD monitor?

- If it is an LCD monitor, what is the number of pixels 
  number of pixels in x and y direction of the monitor?

- What is the number of pixels used by your X-server?
  Check with the command xdpyinfo:

    mfabian@magellan:~$ xdpyinfo |grep dimensions
      dimensions:    3360x1050 pixels (871x272 millimeters)
    mfabian@magellan:~$ 

- Are you using the digital output of your graphics card or the analog?

Comment 25 Oliver Dain 2007-01-09 16:57:00 UTC
I have an LCD monitor (an Acer AL1917 which, BTW, shows up in sax2 under the manufacturer "ACR" instead of "Acer" for some reason). The max resolution of the monitor is 1280 x 1024 which is also what xdpyinfo shows:

oliver@astro:~> xdpyinfo | grep dimensions
  dimensions:    1280x1024 pixels (382x302 millimeters)

I assume max resolution is the same as the pixel count - indeed the pixel pitch listed in the manual is 0.294mm which matches pretty closely (382/0.294 = 1299 which is approx 1280).

I have tried both the DVI and analog outputs. It doesn't seem to matter which I use.

The computer is new, but I used this same monitor with a different computer under openSuSE 10.0 and it looked fantastic.

Thanks very much for not giving up on this!!!
Comment 26 Mike Fabian 2007-01-09 18:17:54 UTC
I'm afraid I just have to give up on this because if the screen shots
are OK, it is definitely not a problem of the fonts or the font
rendering engine.

I have no idea whatsoever how it is possible that your monitor
displays it differently.

I thought that maybe your LCD monitor zooms because your X-server uses
a resolution different from the native resolution of your monitor.

But your last comment #25 shows that this is not the case, you are
using the monitor correctly.

I don't think there is anythink we can fix here, therefore
I have to close this bug as WORKSFORME.

Comment 27 Oliver Dain 2007-02-01 07:50:43 UTC
I FINALLY figured it out. For some reason the gamma correction was totally wrong. Fixing this fixed the fonts issue! Just thought I'd post in case others were having the same problem.
Comment 28 Mike Fabian 2007-02-01 08:50:04 UTC
How did you set the wront gamma correction?
And how did you set the right value now?