Entries tagged “ubuntu”

Fontconfig and Chromium

Thanks to this explanation from Evan Martin, I’ve finally figured out how to get fonts looking right in Chromium on Linux. The crux of the problem is that there are two font configuration systems. UI widgets read settings from one, the panel at System → Preferences → Appearance, while the browser area reads from fontconfig.

I prefer the appearance of full sub-pixel hinting on Ubuntu, but this setting, selected from the preferences panel, wasn’t being propagated to fontconfig, so web pages continued to have blurry text. The fix? Here is my new ~/.fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
        <edit mode="assign" name="rgba">
            <const>rgb</const>
        </edit>
    </match>
</fontconfig>

Evan proposes a test for what hintstyle fontconfig is using:

$ fc-match -v Arial | grep hintstyle
        hintstyle: 3(i)(w)

The hintstyle of “3” indicates full hinting. Ubuntu’s default, slight hinting, would be “1”.

Netbook theme for Ubuntu

Upgraded to Karmic last night. The refresh of the Human theme is quite nice, but the bright orange icons no longer work, so I made a quick remix. Download:

Both versions are designed for 1024×600 netbook screens. For best results, you should also install maximus and window-picker-applet, and setup a single panel at top containing the applet.

Installation

Go to SystemPreferencesAppearance and install from there, or better, extract the tarball to /usr/share/themes as root. The latter will get it to work for system applications too.

Improving font rendering under Ubuntu

Ubuntu ships FreeType with the bytecode interpreter enabled. This works very well for common typefaces such as Vera, DejaVu, Verdana and Georgia at small sizes but somehow doesn’t for other typefaces and sizes.

After some tinkering, I came up with a configuration that works for me:

  1. Open the Terminal and type sudo dpkg-reconfigure fontconfig-config
  2. Choose Autohinter, Automatic for subpixel rendering, and No for bitmapped fonts.
  3. Under System ? Preferences ? Appearance ? Fonts ? Details, choose Subpixel and Slight.
  4. Restart OpenOffice (including the Quickstarter) and Firefox. These two don’t reflect changes automatically.

We’re making two choices here:

  1. Native bytecode interpreter vs the autohinter. I’m not completely sold on one over the other.
  2. Full vs slight subpixel rendering. Full looks fantastic at small sizes (8-9pt) but terrible when large. Slight is less well defined at small sizes, but acceptably well shaped for larger sizes.

Further reading: Comprehensive Ubuntu Font Configuration Guide (written for Gutsy but also applicable to Intrepid).

Update: Disregard the above. The blurriness at small size gets unbearable after a while. Go back to native interpreter, full subpixel hinting, and setup custom workarounds in your ~/.fonts.conf file. Here’s mine:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <test qual="any" name="family" compare="eq">
            <!-- Twitter uses Lucida Grande. The site looks terrible without
                 hintslight enabled. -->
            <string>Lucida Grande</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
        <edit name="hintstyle" mode="assign">
            <const>hintslight</const>
        </edit>
    </match>
</fontconfig>

The Eee PC rocks!

It’s been two months now with my Eee PC and I’m pleased as punch. This is easily among the most useful gadgets I’ve acquired.

The Eee PC is incredibly small and light. It fits everywhere, even in my camera bag with the camera also in it. Despite the miserly 800x480 resolution, or perhaps because of it, I keep all windows maximised and work distraction free. The screen’s just wide enough for a column of text, which makes it a great ebook reader. OpenOffice with read-only documents defaults into viewer mode, which is great. I no longer have to convert stuff into PDF to make a comfortable reading experience, like I needed to do on the Mac. Vim, with my customised vimrc, works splendidly for editing in reStructuredText, my text markup format of choice.

When I’m not working with documents or code, I’m working with people, and XChat when maximised once again delivers the goods. I can keep the device aside, an eye on the conversation, while I’m working on something else.

Because it’s always in my bag, I can pull it out when waiting at a coffee shop, make a note, read something, or otherwise generally be productive instead of twiddling thumbs. The device is low profile and the keyboard comfortable. The battery life isn’t great, but I’ve managed to stretch it as much as 3:30 hours. It lasts long enough between the average visit to the power socket.

That said, the quibbles:

  • The trackpad’s scroll area is way too sensitive. I use a scroll mouse occasionally just for the scrolling comfort.
  • The PgUp/PgDn keys are overloaded on the arrow keys. Navigating documents a page at a time is that much less convenient.
  • Boot time with Hardy is several seconds longer than it should be, while suspend-to-ram sucks juice.
  • I miss Skim. It made reading and annotating PDF on the Mac such a joyous experience. There’s nothing like it on Linux.

All minor. The device overall gets two thumbs up.