LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
LinkBack Search this Thread
Old 07-03-2009, 07:57 PM   #1
jason_m
LQ Newbie
 
Registered: Jun 2009
Posts: 16

Rep: Reputation: 0
Fonts, Firefox, X


Hello,

I should start this by saying that, in general, I don't have a very strong grasp on how fonts are handled on a linux system. I know in the X config, font paths can be passed in, so maybe my issue lies with X and the installed fonts on my system and not any application in particular (firefox).

But, I ran into this with firefox while trying to develop a web site, and so that is what I will use to describe what I am seeing. I am working with a web site that uses Helvetica for its font, and if that is unavailable, if falls back on any sans-serif font. This is specified in a style sheet by the following:
Code:
font-family: Helvetica, sans-serif;
I noticed that commas display poorly on this web site. A screen shot is available at
http://img362.imageshack.us/img362/2408/commas.png

If I zoom in two or more times (ctl++) in firefox, then the commas start to look as they should.

I have these three questions:

1.) If the style sheet allows for "fallback" fonts, how can I tell which firefox is using to display this page?

2.) Is this an issue with firefox, X, or some other library on my system? Or possibly my hardware? (probably not, I have an nVidia GeForce 7600 GT using the proprietary nVidia driver and have a fairly recent 24" monitor running at 1920x1200.)

3.) Is there anything I can do, or is this just the present state of fonts in linux? I have a friend who I had send me a screenshot of the site I am working on from his iphone as well as his MS Vista desktop w/firefox (fairly comparable desktop hardware, same resolution) and the font looks fine in both cases. I have seen several questions about fonts and firefox in linux, and the solution generally is, "fonts will always look crappy at high resolutions, so just change resolution." However, if other systems can properly display the fonts, isn't that answer missing the point?

Thanks
 
Old 07-03-2009, 09:53 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,902

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
It looks strange indeed.

For me firefox works just fine (in that regard, not so well in others). Can you reproduce this same problem in other browsers like konqueror, arora, opera...?

Most systems nowadays use fontconfig, and in which regards that and xft you don't even need the font paths in xorg.conf. In fact you can just drop any ttf font into ~/.fonts/ and it should automagically work. Some distros use custom patches for one or another reason for libxft, fontconfig and other involved packages, to get cleartype-like fonts. However I don't use any of that and I see the fonts perfectly in firefox.

I am not a master in fonts though, and the situation in linux has always seemed to me overly complex. Though lately the thing has gotten better, in my opinion.

Is there a way to see the site live so I can check if I have the same problem with these fonts?
 
Old 07-04-2009, 09:23 AM   #3
jason_m
LQ Newbie
 
Registered: Jun 2009
Posts: 16

Original Poster
Rep: Reputation: 0
I created a stripped down .html document and stylesheet that reproduces this on my machine. The result can be viewed at: http://img125.imageshack.us/img125/633/commas2.png

Below are the index.html and site.css files I am using:
index.html
Code:
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Language" content="en-us" />
  <title>Test</title>
  <link href="site.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <h1>Testing</h1>
  <p>This is a test of sans-serif fonts in firefox.  Mainly, I am interested in how commas display.  But I'll also throw in some other characters to see if anything else looks goofy. !@#$%^&*()_+\.? ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz , , , , </p>
</body>
</html>
site.css
Code:
body {
    font-family: Helvetica, sans-serif;
}
You can just place both of those files in the same directory and point your browser at them.

Thanks

(The screen shot should say "sans serif" instead of "serif", oops. You still get the idea.)

Last edited by jason_m; 07-04-2009 at 09:25 AM.
 
Old 07-05-2009, 04:39 AM   #4
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
Well, mine looks "ok". (Screenshot here)

First, why don't you just use "sans-serif" without Helvetica leaving it to the user's browser and system to show the appropriate sans-serif font?

Second, you probably can't tell which font Firefox is actually using, because a user always can disable the webpage's font choice in Firefox. (I do it, for example, I really don't care for the website's designer's choice, I want readable pages..)

You can check the available font with some JavaScript - which fails to "false" if someone like me uses the parameter settings of not letting the website determine the choice of font. Instead I've set "sans-serif" and "monospace" in Firefox which are the aliases to whatever font defaults to "sans-serif" and "monospace" in my system. (Deja Vu, I think). Here's an example: http://www.lalit.org/lab/javascript-css-font-detect

And here's what my "sans-serif" default font looks like.

Third, the quality of font display under Linux depends on your setting - I use three patches (Cairo, Xft, Freetype) and I configure everything to be fully antialiased and hintstyle full and I choose a rather high resolution of X. (See screenshot for the result...)

Read this thread carefully (ignore the Slackware-part, it works with each and every distribution and many have packages with the patches anyway...) to improve the display quality of fonts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do fonts in IE look so much better than in Firefox? UMG:Chicken_Soüp General 6 11-14-2008 02:35 AM
Firefox fonts raylhm Suse/Novell 2 12-04-2007 06:26 PM
new fonts in firefox prozac Linux - Software 2 12-14-2005 05:27 AM
firefox fonts rino.caldelli Mandriva 2 10-23-2005 05:53 AM
Firefox Fonts jeffman12 Linux - Software 6 06-07-2004 02:10 PM


All times are GMT -5. The time now is 01:34 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration