You are not logged in.

#1 2008-08-04 17:04:20

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Some strange font problems in Firefox

I was wondering if any of you have come across the same problem; that some characters are rendered wrong in Firefox. I haven't noticed it anywhere else in gnome, not even in Epiphany (which doesn't mean Epiphany doesn't have them, but with different font settings and defaults in both browsers it's hard to be sure).

Anyway; the actual problem is this: on many sites certain letters, or parts of them, look strange. For example, parts of "x" and "w" often look thinner than the rest of the text; almost as if you only saw the "shading", "anti-aliasing" or whatever it's called, not the actual line (for lack of a better way of describing how it looks).

This occurs both with and without the cairo-lcd and related packages recommended in the font entry in the wiki. I have the correct dpi for my monitor and I've chosen "Subpixel smoothing (LCD)" in "Appearance" window. Generally, fonts look nice. I've also installed the Microsoft fonts.

So; any ideas what might be the cause of this? For me, getting nice fonts in Gnome hasn't been any problem, but getting most websites to look equally nice in Firefox has turned out to be quite hard.

... Actually, when I'm at it, I'll throw in a few more font-related questions:

Some headings in ubuntuforums.org have a multicolored blur around them. Is that happening to anyone else?

In Epiphanys font configuration you can set the size for variable and fixed width fonts (default value 12). Is this the same setting that is set to 16 by default in most browsers (I think)?

Offline

#2 2008-08-04 21:32:17

xelados
Member
Registered: 2007-06-02
Posts: 314
Website

Re: Some strange font problems in Firefox

Some headings in ubuntuforums.org have a multicolored blur around them. Is that happening to anyone else?

That's what subpixel antialiasing does; for each pixel, there are three subpixels; green, red, and blue. Since it uses the subpixels to antialias, you're going to see slight remnants of color. Changing the orientation of the subpixel antialiasing can help alleviate that.

Offline

#3 2008-08-05 01:12:02

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: Some strange font problems in Firefox

If you are seen those artifacts around text, most likely you're using a CRT monitor, but using font configuration for LCD monitors (sub-pixel hinting). Just disable that, or change to grayscale mode (where it blurs, but not in RGB colors).

If you're indeed using a LCD monitor, but you can still see the artifacts around text, change the order the hinting occurs (RGB, BGR, etc..).

From experience, the best sub-pixel method for fonts (the one that causes less distortion on them) is the "slight hinting" option you see in Gnome font appearance dialog.

Just set those options, and then tweak the DPI values until you find a good one for your monitor. Common values are 96 DPI and 120 DPI.

Last edited by freakcode (2008-08-05 01:16:23)

Offline

#4 2008-08-05 07:58:16

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: Some strange font problems in Firefox

xelados wrote:

That's what subpixel antialiasing does; for each pixel, there are three subpixels; green, red, and blue. Since it uses the subpixels to antialias, you're going to see slight remnants of color. Changing the orientation of the subpixel antialiasing can help alleviate that.

But then you'd think you'd notice it everywhere, at least on text of roughly the same size (which isn't the case). Actually, I think the blur problem might be exclusive to one or some of the microsoft fonts.

freakcode wrote:

If you are seen those artifacts around text, most likely you're using a CRT monitor, but using font configuration for LCD monitors (sub-pixel hinting). Just disable that, or change to grayscale mode (where it blurs, but not in RGB colors).

If you're indeed using a LCD monitor, but you can still see the artifacts around text, change the order the hinting occurs (RGB, BGR, etc..).

From experience, the best sub-pixel method for fonts (the one that causes less distortion on them) is the "slight hinting" option you see in Gnome font appearance dialog.

Just set those options, and then tweak the DPI values until you find a good one for your monitor. Common values are 96 DPI and 120 DPI.

Of course, I should have said what kind of monitor I have in the first post; it's a LCD. But like I said in the first post, text is generally looking good on my system.  I've tried tweaking the settings you both describe but it doesn't get better than the way I have it set up now. The blur occurs only on a few sites (most likely related to one or a few fonts). I'm not sure if the main problem, certain parts of letters becoming so thin they almost disappear, is related to a specific font.

Anyway, thanks for trying to help me!

Offline

#5 2008-08-05 19:00:11

dunc
Member
From: Glasgow, UK
Registered: 2007-06-18
Posts: 559

Re: Some strange font problems in Firefox

z0idberg wrote:

But then you'd think you'd notice it everywhere, at least on text of roughly the same size (which isn't the case). Actually, I think the blur problem might be exclusive to one or some of the microsoft fonts.

Quite possible. Some fonts hint better than others, and of course MS never intended its fonts to be used with anyone else's software. Some of them don't work well here either.


0 Ok, 0:1

Offline

#6 2008-08-05 20:18:45

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: Some strange font problems in Firefox

dunc wrote:
z0idberg wrote:

But then you'd think you'd notice it everywhere, at least on text of roughly the same size (which isn't the case). Actually, I think the blur problem might be exclusive to one or some of the microsoft fonts.

Quite possible. Some fonts hint better than others, and of course MS never intended its fonts to be used with anyone else's software. Some of them don't work well here either.

Turns out that temporarily removing the Microsoft fonts solve at least the ubuntuforums headings problem (more or less). Is there any way to turn of/change the hinting for certain fonts?

By the way, why is it that in Windows I never have to touch the "minimum font size" value in Firefox, whereas it seems to be necessary on all Linux distributions (text being roughly the same size in the rest of the desktop environment)? Not a huge problem, of course, but I'm curious...

Last edited by z0idberg (2008-08-05 20:19:00)

Offline

#7 2008-08-06 19:18:31

dunc
Member
From: Glasgow, UK
Registered: 2007-06-18
Posts: 559

Re: Some strange font problems in Firefox

z0idberg wrote:

Is there any way to turn of/change the hinting for certain fonts?

I think so, but I'm not sure how. It involves fiddling about with /etc/fonts/ or ~/.fonts.conf. This wiki entry shows how to disable bitmap fonts and apply different hinting settings to a particular weight. (Actually, there's some stuff further down that page regarding Mozilla that might have some bearing on your problem.) And This shows how to substitute one font for another. So it's probably possible with a bit of thought. And Googling. smile

Edited crappy quoting.

Last edited by dunc (2008-08-06 19:19:12)


0 Ok, 0:1

Offline

#8 2008-08-07 21:25:51

voky
Member
Registered: 2008-06-29
Posts: 13

Re: Some strange font problems in Firefox

Hi.
I have similar problems with some sites with Minefield and I can't understand why. I have latest firefox and libxft-lcd package. On the left side of image I attached is how i get rendered http://java.net in Arch and on the right is how is it in Kubuntu Hardy. This happens only on few sites.

Note: Image may be resized by your browser.

font_problem.png

Btw I have 118x115 DPI. X log says:
(--) NVIDIA(0): DPI set to (118, 115); computed from "UseEdidDpi" X config

Last edited by voky (2008-08-07 21:32:10)

Offline

#9 2008-08-07 23:01:48

rizzix
Member
Registered: 2005-10-22
Posts: 55

Re: Some strange font problems in Firefox

I have the same problem as ^ above

Offline

#10 2008-08-07 23:06:00

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Some strange font problems in Firefox

That page work fine here. Anitaliasing is turned off (or not turned on) somewhere in your setup.

Offline

#11 2008-08-07 23:54:47

voky
Member
Registered: 2008-06-29
Posts: 13

Re: Some strange font problems in Firefox

I have anitaliasing enabled in ~/.fonts.conf. This happens only on few sites. When I forbid pages to change fonts in Firefox settings it looks OK. That site has 'font-family: lucida,arial,sans-serif' so IMHO it should switch to arial which renders OK, because I havent any lucida font installed. However it doesn't.

Offline

#12 2008-08-08 06:33:15

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: Some strange font problems in Firefox

I get the same problem with the site above. Strange...

Offline

#13 2008-08-08 06:45:20

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Some strange font problems in Firefox

Ditto here, and I've noticed it at other sites as well.  I do think it has something to do with the font declaration.


thayer williams ~ cinderwick.ca

Offline

#14 2008-08-08 07:27:35

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: Some strange font problems in Firefox

I thought that firefox was using a built-in cairo, so if font rendering is only ugly in firefox, you should check out the AUR for some other ff-packages, like the one from spookyet. They are built to use the system-cairo so your fonts should render the same as in your other (GTK-)apps.

You might also want to look at the cairo-cleartype, libxft-cleartype and freetype2-cleartype pacakges in AUR. They are basically the same as the *-lcd-packages, but *-lcd is not developped anymore.

Zl.
/EDIT: To be clear: using the above packages, I'm able to see the java.net-website as it should (and even way better than the Kubuntu-sreenshot posted above IMHO).

Last edited by zenlord (2008-08-08 07:36:51)

Offline

#15 2008-08-08 12:47:30

voky
Member
Registered: 2008-06-29
Posts: 13

Re: Some strange font problems in Firefox

Thanks for suggestion. First I installed {libxft,fontconfig,freetype,cairo}-ubuntu packages from AUR. During the building of firefox-spookyet I tried java.net in Konqueror and Opera and noticed same issue. So after I installed firefox-spookyet I wasn't suprised that nothing has changed. Furthermore, when browsing javadocs left frames in Konqueror are rendered with very ugly fonts even though that frames (html) doesn't set any fonts and defaults in konqueror are set to DejaVu. I'll browse some forums linked from http://wiki.archlinux.org/index.php/Fonts, hope I will better understand this font mess.

Last edited by voky (2008-08-08 12:51:42)

Offline

#16 2008-08-08 16:56:02

rizzix
Member
Registered: 2005-10-22
Posts: 55

Re: Some strange font problems in Firefox

Problem resolved. But I'm not too sure how. Here's what I've done so far:

1) Installed the -lcd equivalents. Didn't like them, so reverted to originals.
2) Inside /etc/fonts/conf.d:  ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf

java.net is nice and smooth now.

Edit: Oh and you'd have to restart X. If you're using something like GDM then you'd might have to restart your computer to see the changes.

Last edited by rizzix (2008-08-08 16:59:45)

Offline

#17 2008-08-09 11:47:56

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: Some strange font problems in Firefox

rizzix wrote:

2) Inside /etc/fonts/conf.d:  ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf

Yep, that worked for me too. Thanks!

zenlord wrote:

I thought that firefox was using a built-in cairo, so if font rendering is only ugly in firefox, you should check out the AUR for some other ff-packages, like the one from spookyet. They are built to use the system-cairo so your fonts should render the same as in your other (GTK-)apps.

You might also want to look at the cairo-cleartype, libxft-cleartype and freetype2-cleartype pacakges in AUR. They are basically the same as the *-lcd-packages, but *-lcd is not developped anymore.

Zl.
/EDIT: To be clear: using the above packages, I'm able to see the java.net-website as it should (and even way better than the Kubuntu-sreenshot posted above IMHO).

Thanks for the tips, didn't help for me, though. Actually, since I first posted, I've noticed that the problem with occasional slightly deformed letters occurs in Gnome outside Firefox too. Not that big of a problem, nevertheless an irritation I'd like to get rid of.

Offline

#18 2008-08-10 15:47:31

voky
Member
Registered: 2008-06-29
Posts: 13

Re: Some strange font problems in Firefox

Thanks rizzix.

Offline

#19 2008-08-10 19:15:39

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Some strange font problems in Firefox

rizzix wrote:

2) Inside /etc/fonts/conf.d:  ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf

java.net is nice and smooth now.

The only problem with this workaround is that it screws with bitmap fonts in Gvim. Gvim won't be able to render fonts like Terminus when this link is present.


thayer williams ~ cinderwick.ca

Offline

#20 2008-08-13 07:45:21

z0idberg
Member
Registered: 2006-06-27
Posts: 20

Re: Some strange font problems in Firefox

I have to bring this topic up again... really, font management on Linux is a jungle once you start getting particular smile.

It seems like the Liberation fonts (at least the serif variety) render too small in Firefox (maybe outside Firefox too?). For me, using DejaVu in Firefox seems to fix the problem with small, almost unreadable text on many sites.

But the thing is, as long as I have the Liberation fonts installed (which I want to, as they look nice as application fonts for the Gnome Desktop) and let sites choose their own fonts (Firefox), the behind-the-scenes automagic that is font management decides, in it's infinite wisdom, that some font the webpage specifies is better of being substituted for Liberation, and so, even though DejaVu is the default in my Firefox settings, the webpage uses the puny Liberation fonts.

Now, I've been reading this thread on the Ubuntu forums: http://ubuntuforums.org/showthread.php?t=804242
Many of the solutions for various font substitution problems seem hackish, and they're talking about Ubuntu anyway. So now, what I'm hoping, is that someone here  will be able to produce an elegant and effective solution that. in a gentle and respectful way, tells my system that it doesn't need to substitute any font with Liberation smile. Can it be done?

Edit: Creating a ~/.fonts.conf file with an alias that substitutes Times (defaults to Liberation) for DejaVu doesn't work. However, substituting Georgia (defaults to DejaVu) for Liberation does. Seems quite strange to me... in reality, I've probably just missed something smile.

Edit again: That is; supposing that the fc-match command does what I think it does, I just picked it up from the Ubuntu forums thread I mentioned.

Last edited by z0idberg (2008-08-13 08:19:24)

Offline

Board footer

Powered by FluxBB