Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

Good fonts under Linux - NOT software

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
18 posts • Page 1 of 1
Author
Message
xcable
Guru
Guru
User avatar
Posts: 424
Joined: Thu Aug 15, 2002 4:47 pm
Location: College Station, Texas
Contact:
Contact xcable
Website

Good fonts under Linux - NOT software

  • Quote

Post by xcable » Mon Jan 15, 2007 3:42 am

Not really a how-to, but something anybody looking for good looking fonts for Linux should know.

Get a monitor/LCD with a dpi* at or near 96 to 100.

*dpi = dot per inch

This is, by far, the most important thing you can do to make your fonts look "good".

Examples :

Acer AL2017 (20 inch) the length is 16 inches horizontally and the resolution is 1400x1050.
1400/16 = 87.5 dpi
Not so good on fonts under Linux.

Now for my laptop with is 1400x900 and is 14.5 inches horizontally.
1400/14.5 = 96.55
Very good fonts under Linux.

The two systems have exactly the same tweaks to make the fonts render the same on each system. Using the free autohinter or BCI, the Laptop always looks better. The holds true for Windows also. But Windows is still better at font rendering than Linux is (freetype and Xorg), and this is something we have accepted because it may never change (patent issues).

My suggestions is to purchase a LCD monitor with at least 1600x1200 resolutions or get a CRT. I have a 1280x1024 19 inch LCD and my co-worker has a 1600x1200 21 inch LCD, and his fonts look amazing compared compare to mine (both running Gentoo Linux and KDE).

--
heath holcomb
Top
Phenax
l33t
l33t
User avatar
Posts: 972
Joined: Fri Mar 10, 2006 8:12 pm

  • Quote

Post by Phenax » Mon Jan 15, 2007 4:01 am

My DPI is around 80.9.. 17.8 inches wide and 1440x900. (19" Widescreen)

An example of my fonts.
Top
xcable
Guru
Guru
User avatar
Posts: 424
Joined: Thu Aug 15, 2002 4:47 pm
Location: College Station, Texas
Contact:
Contact xcable
Website

  • Quote

Post by xcable » Mon Jan 15, 2007 4:23 am

Phenax, yours look good. Please share you setup (Xorg, freetype versions, .font.confs).

--
heath
Top
Phenax
l33t
l33t
User avatar
Posts: 972
Joined: Fri Mar 10, 2006 8:12 pm

  • Quote

Post by Phenax » Mon Jan 15, 2007 4:48 am

My system is ~amd64 and I unhardmasked Freetype-2.2.1. Though, if you just get the latest unhardmasked version, it should look very similar.

xorg-server-1.1.1-r4
freetype-2.2.1

My xorg.conf
My ~/.fonts.conf

Oh, and for Firefox, you probably want to go to
edit->preferences->content
Change the default-font to sans-serif, hit advanced for Fonts & Colors, change Serif and Sans-Serif to sans-serif (I know.. But mine wasn't set to that by default!)

Sans-serif truetype fonts tend to look best.
Top
boniek
Guru
Guru
User avatar
Posts: 373
Joined: Sat Mar 26, 2005 6:02 pm

  • Quote

Post by boniek » Thu Jan 18, 2007 7:15 am

Follow the link in my signature.
[HOWTO]New freetype subpixel font rendering for lcd monitors
Top
eMPee584
Apprentice
Apprentice
User avatar
Posts: 152
Joined: Sat Nov 01, 2003 1:17 am
Location: Aachen, Germany
Contact:
Contact eMPee584
Website

my font config ;=)

  • Quote

Post by eMPee584 » Fri Feb 16, 2007 8:39 pm

I have set my KDE to mainly use Luxi Sans@10Pt, especially as standard browser font, for toolbars and menus and file names in konqueror. For Fixed width I use Bitstream Vera Sans Mono@10Pt and in the taskbar Gentium@9Pt, Desktop font is Sans Serif and for window titles I even use Arial@10Pt. Here's a shot 8)
http://synth-worldz.de/pr/fonts-fonts-fonts.png
"You cannot teach people anything. You can only help them discover it within themselves." --Galileo
expand your state of mind by not watching tv =)
- .... .. ... .-- --- .-. .-.. -.. .. ... .-- . .-.. .-.. .-- .. -.-. -.- . -..
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Wed Mar 28, 2007 12:53 am

Another thing -- unless you set the DisplaySize parameter in xorg.conf, X may very well take your fatass high-res monitor and render at 75 dpi anyway. Here's how to make sure X is taking advantage of your monitor's capability.

As somebody mentioned already, the magic minimum effective resolution needed to render fonts decently seems to be 96dpi. That's a product of your X configuration as well as your physical display. You can see what effective resolution (i.e. "dpi") you're getting like this:

Code: Select all

$ xdpyinfo |grep resolution
  resolution:    96x96 dots per inch
$ xdpyinfo |grep dimensions
  dimensions:    1368x1024 pixels (363x272 millimeters)
If it's 96 or above, you're golden and probably shouldn't bother to read on. If not, you can fix it by setting / adjusting DisplaySize in xorg.conf:

Code: Select all

Section "Monitor"
             .
             .
             .
        DisplaySize     360 270
EndSection
The arguments are the physical size of your display area in millimeters. Mine is 360mm x 270mm.

Unless you've set the DisplaySize parameter explicitly in xorg.conf, you may find that X is making an assumption about your display and that the value it's using is far from optimal. So even if your display is more than capable of 96dpi, you might be getting 75 or something.

I started by actually getting out a ruler and measuring my display area to the best of my ability, then rounded the figures to get a correct 4:3 ratio between the numbers. Setting my DisplaySize to "360 270" yielded the following effective resolutions at various system resolutions:

* 112x112dpi@1600x1200
* 98x98dpi@1400x1050
* 90x96dpi@1280x1024

You can estimate the dpi a given DisplaySize will give you at various resolutions mathematically (shown below) and then test them empirically (by setting DisplaySize in xorg.conf, restarting X, and then checking with xdpyinfo). The results between these two methods won't match precisely -- I think this is not a smooth linear function in X but some kind of step function. While dpi is quite simply dots / inches, it's useful to work in mm because that's what xorg.conf takes as DisplaySize arguments. E.g:

pixels*25.4/millimeters=dpi
i.e. 1600*25.4/360=112.8888

You will also notice that, although I set DisplaySize to be 360 270 in xorg.conf, X has decided that it is "363x272 millimeters" (as reported above by xdpyinfo). However, setting 363x272 in xorg causes X to adjust to something slightly different again. So I just settled on 360 270 as a nice round number that seemed to achieved close to 96dpi at the minimum resolution I use. You don't really have to use the real physical dimensions of your display, but I chose to.

Then I actually went on to create a custom modeline that achieves precisely 96x96dpi with DisplaySize 360 270. (I'm running at "1368x1024 @ 85 Hz"). I'm not sure I really got a perceptible improvement over 1280x1024, but it's at least as clear and I get a bit more real estate to work in. (If you're interested, see the man page gtf(1).) Also in "Section Monitor", it looks like this:

Code: Select all

        # Custom modeline 1368x1024 @ 85.00 Hz (GTF) hsync: 91.38 kHz; pclk: 170.32 MHz
        Modeline "1368x1024"  170.32  1368 1464 1616 1864  1024 1025 1028 1075  -HSync +Vsync
As to the fonts, I like:
Screen Font: Bitstream Vera Sans Roman 11pt
Fixed Width / Terminal: Luxi Mono 10pt
Top
i92guboj
Bodhisattva
Bodhisattva
User avatar
Posts: 10315
Joined: Tue Nov 30, 2004 8:17 pm
Location: Córdoba (Spain)

Re: Good fonts under Linux - NOT software

  • Quote

Post by i92guboj » Wed Mar 28, 2007 1:49 am

xcable wrote:Not really a how-to, but something anybody looking for good looking fonts for Linux should know.

Get a monitor/LCD with a dpi* at or near 96 to 100.

*dpi = dot per inch

This is, by far, the most important thing you can do to make your fonts look "good".

Examples :

Acer AL2017 (20 inch) the length is 16 inches horizontally and the resolution is 1400x1050.
1400/16 = 87.5 dpi
Not so good on fonts under Linux.

Now for my laptop with is 1400x900 and is 14.5 inches horizontally.
1400/14.5 = 96.55
Very good fonts under Linux.
It is true that the quality of the display device is important, but nowadays, almost anything has enough quality level. Most times it is just missconfiguration. If you set your correct dpi, choose the fonts wisely, and turn on antialias if using true type fonts, everything should be set.
The two systems have exactly the same tweaks to make the fonts render the same on each system. Using the free autohinter or BCI, the Laptop always looks better. The holds true for Windows also. But Windows is still better at font rendering than Linux is (freetype and Xorg), and this is something we have accepted because it may never change (patent issues).
I particularty don't care if it is better or not, but in my case, I have yet to see a windows installation that can match my linux desktop in which regards font rendering. I suppose it is all about opinions, I think this text is much clearer. Windows can't beat it even if you use cleartype (in fact, cleartype makes the font so blurred that depending on many factors, can be even worse.
Top
j0mt31x
n00b
n00b
User avatar
Posts: 15
Joined: Mon Sep 04, 2006 10:53 pm
Location: Barcelona

  • Quote

Post by j0mt31x » Wed Mar 28, 2007 2:36 am

those who like M$ fonts might want to have a look at this:

http://www.ubuntuforums.org/showthread.php?t=208396

sorry for the blasphem
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Wed Mar 28, 2007 8:30 pm

Thanks. Now a bunch of people who already know how to install fonts in Gentoo (or any Linux system, probably) have a nice link to a thread showing how to use Debian's package management system to install Microsoft fonts in Ubuntu. That's helpful.
:?
Top
j0mt31x
n00b
n00b
User avatar
Posts: 15
Joined: Mon Sep 04, 2006 10:53 pm
Location: Barcelona

  • Quote

Post by j0mt31x » Wed Mar 28, 2007 8:44 pm

dude, the packages mentioned on the thread are available on gentoo too, and modyfing some xml files is no big deal for a gentoo user. actually, it is way more complicated to install the distro.

anyway, i am not encouraging people to do that tweaking. i find it disgusting to have a windows looking desktop like that, but some users may like it. gentoo is about choice, isn't it?
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Thu Mar 29, 2007 12:07 am

Yeah, you're right. Sorry - I was low on caffeine. :)
Top
Progman3K
l33t
l33t
User avatar
Posts: 805
Joined: Sat Jan 03, 2004 11:59 pm
Contact:
Contact Progman3K
Website

What if you use a projector?

  • Quote

Post by Progman3K » Sat Apr 07, 2007 4:13 am

I'm using a DLP XGA projector, so I have an (approximately) 102" screen.

My question is - what is the appropriate DisplaySize in such a situation?
Top
leonglass
Apprentice
Apprentice
Posts: 278
Joined: Tue Aug 08, 2006 11:36 am
Contact:
Contact leonglass
Website

  • Quote

Post by leonglass » Sat Apr 07, 2007 8:11 am

BoneKracker

I had a look through the parts you identified and found that I have a resolution of 89x87 dots per inch and dimensions of 1440x900 pixels (411x263 millimeters). I then measured my display and it is pretty spot on. Is there a way I can get my resolution up.
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Mon Apr 09, 2007 4:51 pm

You can artificially force X to load with a "dpi=96" command option. That's the easy way.

Alternatively, you can adjust your displaysize, that will change the dpi that is yielded at any given pixel-resolution. Keep in mind that your monitor may be spreading or contracting the image a bit, so don't be afraid to put in dimensions that don't precisely match what you measured.

In fact, there really isn't any reason the dimensions you enter have to match reality at all (my instincts just tell me things will work out better if they are, because that is probably guiding the software to adhere more closely to the hardware design).

1400 "dots" divided 96 = inches
convert inches to mm and that's the number that goes in the DisplaySize parameter

(of course, you have to do it once for the X dimension and once for Y)

After you adjust it, you can check again with xdpyinfo to see how it came out. It's not a smooth function (I think it's a step function), so you'll have to play with the numbers a bit to get it to come out at exactly 96.

If you just want it "higher", pick your target (e.g., 120) and do the same procedure (or use the command line option).

If you set it to something other than 96, though, make sure any settings you have in your windows manager and/or apps match it (e.g. gnome, kde, firefox).
Top
broken_chaos
Guru
Guru
Posts: 370
Joined: Wed Jan 18, 2006 7:47 am
Location: Ontario, Canada

  • Quote

Post by broken_chaos » Tue Apr 10, 2007 6:53 am

I have a 1280x800 laptop display, which is about 12" diagonally... 125x125 DPI! Fonts look exceptional on this thing at proper DPI, with some tweaks (BCI and the correct subpixel/hinting/etc. options - nothing fancy, or even out of the amd64 stable portage tree). Sample screenshot.

(See the menus on Konqueror? The labels on them (Location, Edit, etc.) are a size SEVEN font. Yes, that's what insane DPI does to font sizes!)
Top
leonglass
Apprentice
Apprentice
Posts: 278
Joined: Tue Aug 08, 2006 11:36 am
Contact:
Contact leonglass
Website

  • Quote

Post by leonglass » Tue Apr 10, 2007 9:06 am

I have to say I am not sure I should bother. On this site the fonts look a little bit scrappy but on a lot of other sites the fonts look as good as the screenshot from broken_chaos.
Top
comprookie2000
Retired Dev
Retired Dev
User avatar
Posts: 925
Joined: Sun Jul 25, 2004 5:39 am
Location: Sun City Center, Florida
Contact:
Contact comprookie2000
Website

  • Quote

Post by comprookie2000 » Sun Apr 15, 2007 2:33 pm

Mine look fine at 89x87
http://abbottdavid.com/pictures/2007-04 ... _scrot.png
http://dev.gentoo.org/~dabbott/
Top
Post Reply

18 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic