« November 2008 | Main | January 2009 »

December 2008 Archives

December 1, 2008

Failure of the Open Source business model

Great article I saw on my facebook feed (thanks Eli!)

And therein lies the great paradox: Open-source code is generally great code, not requiring much support. So open-source companies that rely on support and service alone are not long for this world. The traditional open-source business model that relies solely on support and service revenue streams is failing to meet the expectations of investors.

December 5, 2008

Blog systems

I was reading through some of my very old posts and noticed that I used to spend a lot of time playing with different blog systems. At one point, I switched between wordpress and textpattern several times, constantly looking for the right set of features.

I seemed to have been very preoccupied with the relative featurefulness of the templating systems, and the flexibility of the categorization mechanisms. Then I suddenly stopped. As of now, I've been using movable type for over two years now. I don't remember why I stopped switching, but I think it was because MT was developed by a company, and somehow I thought that would be better for me.

Looking back, what a waste of time it was. The most successful blog I ever had was on blogger, and I used a super simple template. Blogger doesn't have any categorization (only keywords). And it still didn't matter.

For one thing, blog templates hardly ever make a difference. The best blogs have simple, easy-to-read and easy-to-navigate templates (besides, most people will read your blog through an RSS reader). Then there's categorization. Unless you're using a blog system instead of a proper CMS, categorization hardly ever matters too. Neither does keywords, because a Google index of your site will always do better (and bring you more hits anyways).

It also turns out that the things that matter, the free systems tend to not do so well. Commenter ID management, Comment threading, spam filtering, etc. In blogger, these things are very simple and require no effort. Google gets to figure out all the details for you.

So as of now, I'm still using MT, but that's only out of laziness. If I had the motivation, I'd probably just move this to blogger or wordpress.com or something. It would be one less thing to worry about.

December 8, 2008

VMware Tools install in Fedora 10

Nothing special really, but there are a few fedora-isms.

  1. Install the rpm package from the tools dvd that gets automounted.
  2. Install the kernel-devel package that matches your processor type, which you can find out by looking at the kernel name obtained from uname -a. It appears that fedora doesn't create the /usr/src/linux symlink for you, but that's OK, since nowadays installers find it through the proper kernel-version-specific /lib/modules/foo-x.y.z/build symlink
  3. Run /usr/bin/vmware-config-tools.pl as root
  4. Optionally, if you don't want to restart X, just run vmware-user from the command line (as your logged in user, not root)

I think this the most trouble-free Linux guest install I've ever done.

That Itch

No, not that itch.

I'm referring to the fact that I am now in the part of my 2-year circadian cycle where I want to buy a Mac again. It's been a long time since I had the Powerbook, and there have been several developments since then that make me think things will be a little better this time around.

  • iPhone: No matter how I look at it, I can't see myself going with a blackberry instead of an iPhone in the future. I waited to see the Storm, and the Storm sucked. Sure it might get a little better, but I don't think it will get better enough.

    The only thing that the Blackberry still has over the iPhone is mail search. On the other hand iPhone now has a better SDK, better builtin apps (like youtube, street view, and photos), and a better development trajectory. Once I get the iPhone, then I know I'm going to get sucked in to the rest of it. I'll want iTunes (of course), then I'll say iTunes runs better on a Mac, or I can only dabble with the iPhone SDK on a Mac, etc. etc.

  • Fusion: With the Powerbook, running windows stuff was totally out of the question. Well, there was VirtualPC, but it sucked, and it sucked hard and slow. Nowadays, Fusion keeps getting better and better, and it is certainly enough to fill all the little gaps.
  • Exchange support: Hopefully, if my company finally switches off of Exchange, this won't matter. But until then, this has always been one area where using a Mac sucked. Fusion makes it a little better, and Apple officially supporting it will make it a lot better. And they did it pretty well for the iPhone, so hopefully they won't fuck it up too bad for Mail.app.

Oh yea, there's also that other reason of now I have a real reason to want to not spend as much time dicking around on the computer at home. If possible, I'd like to focus on producing content in various ways, which I hear Macs are pretty good for. The amount of time I've spent recently trying to produce an h.264-encoded video for smugmug to consume has been just short of a debacle. (Sure, Win7 might make things a little bit better, but I still get the feeling that Win7 is still going to be Windows, and not in the good way).

December 15, 2008

Restoring nice hinted fonts on Ubuntu 8.10

The Ubuntu folks seem to change around their default font settings every release. Whatever that's fine. But it is worth nothing that the default "subpixel" setting in the gnome appearance dialog now means "subpixel + slight hinting" whereas previously it meant "subpixel + full hinting"

Since 8.04, though, they've committed a crime, IMHO. There's some new fontconfig magic which automatically aliases "Times" to the "Nimbus Roman" family (or Liberation, if you have it installed), both which render like crap. Those fonts used to resolve to the DejaVu family, which while look different from Times and Helvetica and the like for which they serve as substitutes, still render acceptably under the "subpixel + full hinting" mode.

As far as I'm concerned, there are only five fonts that render well on Linux under this mode. Dejavu Sans, Serif, and Mono, and Droid Sans and Mono. Any settings that cause any fonts other than these to get picked should be avoided.

Thankfully, on 8.10, it's pretty easy to restore the old behavior. Go into your /etc/fonts/conf.d directory and delete 30-metric-aliases.conf and 30-urw-aliases.conf.

You can verify the settings are now correct by typing fc-match "Times" in a terminal, and making sure "DejaVu Serif" is returned.

Speaking of which, I thought Liberation fonts were supposed to look good under Linux. Why do they still look like crap?

December 18, 2008

Linux font progress?

So I finally got around to hacking freetype yesterday. All I did was modify the FIR filter weights that are used for the "lcddefault"-style filtering. Where as they use to be a [1, 4, 7, 4, 1] weighting (relative), I tried a [1, 3, 4, 3, 1]. To my eyes, it results in a lot less fringing. I can use the slight autohinter with subpixel, and get pretty good results across most fonts (even msttcorefonts). Below is a shot of Arial being used on a google search result page. This is by far the best I've seen Arial look on Linux. Ever.

firefox-crop.png

December 22, 2008

More font progress?

More hacking. I wrote a patch so that freetype will optionally generate the FIR filter it used during subpixel rendering on-the-fly based on an environment variable. I'll put the patch and packages up shortly.

Here's another shot of the "hello" google search. Look better than the last one? I dunno. It's certainly less fringy to me.

New firefox shot w/ freetype patch

It probably depends on your screen. That's why I made it configurable.

December 23, 2008

"Dynamic" FIR filter patch

This patch modifies freetype to look for a "FT_FITLER_PARAMS" environment variable, and then dynamically generate a FIR filter matrix from those parameters.

Patch file here. It applies against freetype 2.3.7 from the ubuntu repository (though it should apply just fine to upstream 2.3.7.

FT_FITLER_PARAMS should have two floating point numbers separated by a space. Each number should be between 0.0 and 1.0.

Internally, the default filter used has the weights [ 0x10, 0x40, 0x70, 0x40, 0x10 ]. You can imagine a filter as being a 5x1 matrix, each cell containing a "weight" for which all add up to a normalized value (in this case 255).

Instead of dealing with byte values, my patch accepts float values. So instead of thinking about how to distribute 255 across five slots, you think about how to distribute a total of 1.0 across five slots.

Along this line of thinking, the first value in FT_FILTER_PARAMS is the value of the "peak" slot. You can think of the filters as having only three meaningful positions [edge, mid, peak, mid, edge]. So the first value specifies the peak, and the second value specifies the fraction of the remaining weight that is given to the "mid" slot vs. the "edge" slot.

In practice, I find that for the two screens that I have, a value of FT_FILTER_PARAMS="0.39 0.61" works pretty well. That results in the matrix [30, 47, 99, 47 33]

If you look at Windows and its "ClearType Tuner" tool, it only has one value to configure. I'm not really even sure what that value controls, but you could imagine in the freetype scheme being able to generate the entire filter matrix based on one parameter, if you could characterize the optimal relationship between the peak, mid, and edge values. Unfortunately, I'm not signal theorist, so I have to do it experimentally. And the above values are what look best to my eyes so far.

Interestingly, the more that you raise the "peak" value, the thinner the letter forms become. The more that you raise the second parameter (i.e., you give more weight to the "mid" slots over the "edge" slots) the more contrast you get, but the more you're likely to introduce fringing. You can do quite a bit of experimenting if you relaunch a small program like leafpad over and over again with different values.

Ideally, these values you could set per-font through fontconfig. But that's a lot more code that I don't have time to write. Also, in the end, I still prefer both OSX and Vista font rendering over whatever I can achieve with this patch. Perhaps I just haven't found the right matrix yet, but I also think it has to do with the lack of gamma-correct blending when rendering the text. A comment in the original code notes that the values in the original matrix actually add up to more than 255, providing a sort of cheap gamma correction. From my limited understanding of gamma correction, however, this seems like the wrong place to embed such an adjustment.

And finally here's a 32bit Ubuntu package that you can install onto an Ubuntu system to get the patched freetype library. As usual, no guarantees, and don't come running to me if this makes your computer explode due to its awesomeness.

BTW, writing a patch like this makes me never want to write something similar again. I put a fair amount of time into this, and all I got was a hacky solution. The real integrated way of doing this spans many projects: cairo, xft, freetype, fontconfig. They are all essential to the desktop experience, and yet they are maintained by different peopled with different interests, which means probably multiple battles with different upstreams and multiple headaches. I saw how much trouble David Turner had getting his subpixel support into all the various pieces, and I don't wish to go through the same exercise. Hacking on code in your spare time is fun. Fighting the fight with the upstream projects doesn't sound like fun. I suppose you could pay me to do it, but it would have to be a non-trivial amount. Yay open source.

December 30, 2008

Package development based on VCS

I've always been annoyed that distros don't do their package management using VCS systems. I mean, how hard is it, really? You import tarballs. Maintain local patches. Build packages from your source tree. Yes, sometimes you might have to translate between upstream VCS's and your VCS of choice, but still, the benefits seem to far outweight the cost.

And yet it's still not being done widely.

There appears to be hope, however. David Robbins' new Gentoo offshoot seems to use Git for the portage tree (again, no brainer here.. using portage overlay trees to maintain local changes is just retarded). But more encouragingly, I found this page, detailing Ubuntu's plans to move everything to bzr, and deprecate the usage of apt-get source altogether. About fricking time I say. Lets just hope something actually comes of this.

About December 2008

This page contains all entries posted to LevelsOfDetail in December 2008. They are listed from oldest to newest.

November 2008 is the previous archive.

January 2009 is the next archive.

Many more can be found on the main index page or by looking through the archives.