You are not logged in.

#1 2010-11-23 15:05:51

taavi
Member
From: Tartu, Estonia
Registered: 2010-10-10
Posts: 50
Website

[SOLVED] Suggestions on font rendering

Hi,

Background: I've used Linux for good share of time now, but some years ago I switched from whatever distro I was using at the moment (probably Gentoo) to Ubuntu and since then I've dumbed down about some things. Like internal workings for some basic things like fonts. Since Ubuntu served me well with it out-of-the-box experience I didn't have to go inside how things work. But there were some other things that wasn't enough for me and now I switch to Arch (which I used for short time before Ubuntu-times and I've had my sympathy for it since then.

Problem: I lately switched my destkop from Ubuntu to Arch. I've got most things working as they should with no or few troubles. I like what I have -- quick, responsive and robust system. One thing that I don't know how to solve is font rendering. I've followed tips in wiki (https://wiki.archlinux.org/index.php/Font_Configuration), but I'm out of ideas what I'm doing wrong. For starters I give you comparison of my Firefox rendering on default Ubuntu and Arch right now. Screenshots should be describing what's wrong in Arch right now: Ubuntu vs Arch. If it's related to issue somehow, I use X.org radeon drivers.

I'm interested in solving this issue as well as understanding what's behind all of this rendering/subpixelsmoothing/etc.

If that all topic is FAQ, please be kind to point out where to study further.

Last edited by taavi (2010-11-24 13:03:32)

Offline

#2 2010-11-23 15:13:03

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Suggestions on font rendering

I think most of what you want can be found here: https://wiki.archlinux.org/index.php/Fo … d_packages

If you install the Ubuntu packages mentioned there, and then follow the instructions for Infinality, your fonts should look great.

The xkcd problem is because they use the Lucida font, here is a thread about that: https://bbs.archlinux.org/viewtopic.php?id=82660


ᶘ ᵒᴥᵒᶅ

Offline

#3 2010-11-23 16:42:52

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: [SOLVED] Suggestions on font rendering

This works for me, stolen from ubuntu sharp fonts. I use openbox so I don't know if kde/gnome would override these settings if that's what you use.

$ cat /etc/fonts/conf.d/99-sharp-fonts.conf 
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcdlegacy</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>
</fontconfig>
$ cat /etc/X11/Xresources/sharp-fonts 
Xft.antialias:  true
Xft.hinting:    true
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcdlegacy
Xft.rgba:       rgb

Offline

#4 2010-11-23 16:45:49

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [SOLVED] Suggestions on font rendering

Keep in mind that the Firefox in the main Arch repositories is not compiled using system cairo and hence ignores your font settings. I've gotten around this by installing firefox-pgo from AUR instead, but if anyone knows of a better solution, I'd love to hear it.

Offline

#5 2010-11-23 17:10:08

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Suggestions on font rendering

frabjous wrote:

I've gotten around this by installing firefox-pgo from AUR instead, but if anyone knows of a better solution, I'd love to hear it.

I switched browsers and am still glad that i did..


ᶘ ᵒᴥᵒᶅ

Offline

#6 2010-11-23 17:49:08

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [SOLVED] Suggestions on font rendering

I'm too hooked on vimperator to switch from Firefox. (Yes, I've tried jumanji, and vimprobable, and uzbl, and dwb, and other vim-like browsers, but they all have huge limitations by comparison... or at least require too much effort to set up.)

Offline

#7 2010-11-23 18:09:03

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: [SOLVED] Suggestions on font rendering

freetype2-infinality + libxft-lcd + using the .fonts.conf from infinality's site (tweaked to your liking) will get you the best looking fonts. There are links to what you need on the wiki article.

Firefox just needs to be recompiled with system cairo. An easy way to do it would be to use the precompiled firefox-beta package.

You probably also want to install ttf-google-fonts, ttf-ms-fonts and ttf-vista-fonts (google/vista are in the AUR), so you have all the commonly used web fonts to work with, along with some high quality desktop fonts (consolas or inconsolata for terminals, etc.).

Quick explanation of the terms (I'll add it to the wiki at some point):

antialiasing - smooths edges
subpixel rendering - uses subpixels (the red, blue and green pixels, that make up an actual pixel) to triple horizontal resolution
hinting (what freetype calls "hinting" at least) - aligns fonts to pixel grids, based on hinting instructions they provide (aka truetype hinting) - this looks great for fonts with good hinting instructions
autohint - ignores the built-in hinting instructions, and aligns them to the grid automatically (without the infinality patches, this looks pretty horrible, but with them, it's fantastic for fonts that don't come with good hinting instructions)

Infinality's config shows you what you can do with fontconfig, it uses normal hinting for fonts with good instructions, and autohints everything else (in the "Infinality" profile at least, there are other ones provided too).

EDIT: I improved the font configuration page a bit lot more, so these explanations are now on the page.

Last edited by thestinger (2010-11-23 21:38:04)

Offline

#8 2010-11-24 09:58:16

taavi
Member
From: Tartu, Estonia
Registered: 2010-10-10
Posts: 50
Website

Re: [SOLVED] Suggestions on font rendering

Thank you everyone with quick and informative answers. I've installed infinality's freetype and libxft-lcd. I installed some fonts (like google and vista) and also firefox-pgo. XKCD (lol same screenshots from the other thread as I did) is now fixed. What isn't so beautiful is monospace on my console. I looked at consolas and didn't like it.

Here is my terminal screenshot, so as you can see something right, but I don't know why those fonts are so blurry. Any ideas?

And some conf files:

[11:59:51 taavi@hyperion ~]$ cat /etc/fonts/conf.d/99-sharp-fonts.conf 
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcdlegacy</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>
</fontconfig>
[11:59:58 taavi@hyperion ~]$ cat /etc/X11/Xresources/sharp-fonts 
Xft.antialias:  true
Xft.hinting:    true
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcdlegacy
Xft.rgba:       rgb
[12:00:01 taavi@hyperion ~]$ cat .font-conf
cat: .font-conf: No such file or directory

Last edited by taavi (2010-11-24 10:01:21)

Offline

#9 2010-11-24 10:34:30

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Suggestions on font rendering

You should probably read Infinality's blog again, paying attention to local.conf and the environment variables. Or see my patch.

It's ~/.fonts.conf

Offline

#10 2010-11-24 11:00:16

taavi
Member
From: Tartu, Estonia
Registered: 2010-10-10
Posts: 50
Website

Re: [SOLVED] Suggestions on font rendering

Thank you brebs. It was my mistake. I got it working like charm after carefully following blog. You made my day! : )

Offline

#11 2010-11-24 11:16:20

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Suggestions on font rendering

Please mark your thread solved if you deem it so taavi. smile


ᶘ ᵒᴥᵒᶅ

Offline

#12 2010-11-24 13:04:18

taavi
Member
From: Tartu, Estonia
Registered: 2010-10-10
Posts: 50
Website

Re: [SOLVED] Suggestions on font rendering

Thank you for remainder. Won't happen again.

Offline

Board footer

Powered by FluxBB