Closed Bug 375591 Opened 17 years ago Closed 16 years ago

Minefield doesn't respect font settings

Categories

(Core :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 404637

People

(Reporter: matthias_berndt, Unassigned)

References

Details

Attachments

(6 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a4pre) Gecko/20070327 Minefield/3.0a4pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a4pre) Gecko/20070327 Minefield/3.0a4pre

Hi,

using the KDE control panel, i've set up my computer so that subpixel rendering is used for all fonts (afaik, the KDE control panel is only frontend for fontconfig, but I'm not sure about that). All my KDE and gtk apps display fonts accordingly, and also Firefox 2 respected those settings. Minefield currently doesn't : :(

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Version: unspecified → Trunk
Component: OS Integration → General
Product: Firefox → Core
QA Contact: os.integration → general
I can confirm it, on Ubuntu 7.10 (I did notice it on 7.04 too).

The actual settings Minefield uses seem rather random, but much more based on fontconfig than on my Gnome settings. For instance, on the fontconfig-config package configuration, if I set the font tuning method to None (which I believe should disable hinting), Minefield seems to start applying aggressive, full hinting to fonts.

Right now I managed to get it somewhere close to my settings (slight hinting, subpixel smoothing), but it doesn't look as good as other apps, and by looking closely I can see it doesn't use as many levels of intermediate colors as it should.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007102004 Minefield/3.0a9pre
Comparison between GTK+ (made with a label on Glade), Firefox 2 and a recent Minefield build. See how Firefox 2 renders pretty much the same as GTK, if not absolutely equal (I haven't made an exact-pixel comparison).

I chose small-size and italic fonts because they illustrate better the effect. Courier New is particularly affected, since it is so thin that most of its vertical strokes become less than one pixel wide and show heavy color distortion.

Rendering libraries: Ubuntu 7.10, libxft2 2.1.12, libfreetype6 2.3.5, fontconfig 2.4.2.
Settings: slight hinting using native hinters, grayscale anti-aliasing on gnome-appearance-properties and forced subpixel anti-aliasing via fontconfig (this is the recommended hack to make OpenOffice.org render fonts decently, but even when I had Ubuntu's default settings I had similar problems).
I encountered the same problem in Ubuntu 7.10, as in this post.

http://forums.mozillazine.org/viewtopic.php?t=602280
CCing stuart.
I have the same problem using firefox 3.0~alpha8-0 (included in Kubuntu 7.10 and Ubuntu 7.10 repos) and firefox-3.0b2pre.en-US.linux-i686.tar.bz2 (yesterday build). In firefox 2.0.0.8 the fonts look great. It seems that firefox 3 is beign too agressive hinting fonts because they look too thin compared to the rest of the applications. 

I have tried all possible combinations of hinting/antialias using the KDE font preferences. In addition, I have tried echoing the preferences:

echo Xft.antialias: 1 | xrdb -merge

echo Xft.hintstyle: hintnone | xrdb -merge

echo Xft.hintstyle: hintslight  | xrdb -merge

echo Xft.hintstyle: hintmedium | xrdb -merge

echo Xft.hintstyle: hintfull | xrdb -merge

The best combination is Xft.antialias: 1 and Xft.hintstyle: hintfull because with these options the fonts are antialiased, but look too thin. All the other options produce ugly fonts. BTW, I use subpixel hinting (Xft.rgba: rgb).

I can provide more information for hunting this bug.
Apparently the difference is related to the cairo version. The attached screenshot was done on Ubuntu 7.10.
The Ubuntu version there is 1.4.10, while Firefox cairo version should be close to the snapshot version 1.5.2.
For none or slight hinting, the rendering is similar between cairo 1.4 and 1.5, but for medium and full the 1.5 cairo version is a bit more "aggressive", which explains why the fonts looks thinner.

You could upgrade your cairo version to 1.5 on your system if you want more consistency between Firefox 3 and the other applications.

On the screenshot, we can see that there is no difference between medium and full hinting on both cairo versions. My opinion is that it would be great to have the medium hinting with cairo 1.5 look like the full/medium one of cairo 1.4. This would make a more progressive transition between slight and full, for people who prefer an intermediate setting.
on top: native GTK app.
bottom: Firefox trunk

I just tested on Fedora 8, and the rendering between Firefox 3 and the native GTK apps is exactly the same. Maybe the rendering depends on the font used. Cairo, freetype and fontconfig are at the same version between Ubuntu 7.10 and Fedora 8 (1.4.10, 2.3.5 and 2.4.2 respectively).
I think this is a problem with the default settings in Firefox. For whatever reason, Firefox 3 uses a serif font instead of the sans-serif default from GTK. 
Attached image Firefox screenshot
I should note I use slight hinting, and I'm having this problem. I also installed Ubuntu 7.10 on a brand new machine last week, and right on the first local system start, before any updates or config changes (other than enabling subpixel anti-aliasing and slight hinting via gnome-appearance-properties) were made, I installed Minefield, and experienced the same results as before.

Also, I can assure I experience it on every font I have tried so far. That includes several free fonts, Microsoft's core fonts, and even Office 2007's ClearType series.

Now for something weird: on my new computer at work (also running Ubuntu 7.10), *all* text rendering looks as bad as Minefield does at home, on every application, since the first day.

To quickly sum it up:
- Old home box: nVidia card, Ubuntu looked nice, Minefield looked horrible;
- New home box: same story;
- Old work box: ATI card, Ubuntu looked nice (in grayscale; its monitor as a CRT one), Minefield seemed perfect
- New work box: ATI card, Ubuntu looks like **** (both on grayscale and on subpixel), Minefield looks the same. At least one of my coworkers is having the same issue with font rendering on the whole system.
All of them use (or used) Ubuntu 7.10 with the distribution's standard proprietary video drivers. All hinting styles seem to be affected.

I can't really make any correlations here, it's almost like it is a random occurrence...
I did some investigations, and I found out why the font rendering is different between Minefield and the other GTK/Pango applications. Ubuntu is patching cairo to include support for lcd-filtering while the cairo version used in Minefield is not patched.

Hopefully, the lcd-filtering patch will be integrated upstream in the future (http://bugs.freedesktop.org/show_bug.cgi?id=10301)
Regarding comment #11, after some investigation, I found out the true problem on my new work computer is the monitor, so please disregard the comments about it.
I've compiled Minefield from trunk myself, using only Ubuntu-distributed libraries (like libcairo2-dev), but the text rendering remained the same. Is there anything obvious I'm missing?
(In reply to comment #14)
> I've compiled Minefield from trunk myself, using only Ubuntu-distributed
> libraries (like libcairo2-dev), but the text rendering remained the same. Is
> there anything obvious I'm missing?

Did you use the --enable-system-cairo in your .mozconfig? Note that you'll need cairo >= 1.5. That's only in Hardy for now.

Otherwise you can patch the in-tree cairo version using the patch on https://bugs.freedesktop.org/show_bug.cgi?id=10301
I find that
  $ echo Xft.rgba: none | xrdb -merge
is needed to cause proper display, as configured in xfce-mcs-manager and also in fontconfig-config. Something's not making use of the settings or is trying to second-guess them (LCD monitor, but I can tell when RGB alleged subpixel a-a is in use - colour fringes are visible).

(Debian testing/unstable; Minefield 3 beta 3 compiled from source. I've not yet tried cairo from experimental.)
The main issue this bug covers is related to the apparent color fringes. So I'll solve this as a duplicate of bug 404637 which has a better description.

Please file another bug if you still see font issues not related to color fringes on latest trunk (be sure to check for existing bugs first of course).
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
As you can see on the screenshot, Cairo 1.5 is rendering fonts incorrectly (my preferred settings are lcd subpixel rendering with slight hinting) and also is selecting wrong font - it should be a Helvetica, not Verdana-like one.

The problem does not exist on Windows machine. I've posted this on bugzilla.redhat.com: https://bugzilla.redhat.com/show_bug.cgi?id=244384
Could be fontconfig / pango related. I remember seeing similar issues with font selection, are you on KDE?

For the dpi, try setting it to -1 so that it matches your desktop setting. I'll try to have a look at the bugs you reported when bugzilla is in better shape.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: