this space intentionally left blank

May 27, 2009

Filed under: journalism»new_media

SCOTUS Nom nom nom

Are you, like all of DC, enraptured by the Sotomayor nomination? Feel free to keep track of the confirmation process (and compare it to past nominees, both successful and not) using CQ's interactive Supreme Court nomination graphic.

I'll tell you what killed me on this one: fonts. Our new special projects team member used to be the print graphics reporter, and as such she wanted to use the print fonts, like Benton Gothic. Don't get me wrong, Benton Gothic is a really nice font. But embedding fonts in Flash--particularly via code--is not a fun process. To be blunt, it's clumsy and unreliable. Of course, if your computer has the font, Flash will often pick it up. So interactives with embeds have to be tested on a (separate) clean platform, for which I use one of my VMs. This reveals another frustration: text rendering in Flash is incredibly inconsistent across platforms.

Now, better people than I (read: people who actually care) have commented on the difference between text on Mac, Windows, and Linux. In general, Microsoft respects the pixel grid, while Apple mimics print. Linux, as usual, offers a range of choices that approximate (but don't exactly match) the other two. I should add that while lots of people complain about font rendering on Linux, in my experience it's not that the type engine is bad so much as the fonts themselves are awful. Microsoft has spent a lot of money on great-looking screen fonts, and Apple just licenses classic print fonts, neither of which is easy for free software to match.

Regardless, for whatever reason, Flash seems to piggyback on the host platform's font rendering for its text. This may seem odd, given Adobe's prominence in type-layout software, but I'm guess it's meant to be "cheap" in terms of runtime size and speed--both factors in Flash's success over Java as a multiplatform client. Now that they're dominant, though, I wish they'd spend a few kB on better font handling. When I look at my interactives on a different OS, the rendering changes don't just mean that it looks a little different, maybe blurrier or a bit more spidery, depending on your preference. Suddenly, fonts overflow their textfields, or dynamic layouts shift in undesired directions. If I wanted to fight with the text engine, I'd use HTML!

That's not even to discuss the outright bugs. In our scrolling map, there's a "tooltip" consisting of a floating TextField object. It follows the mouse and identifies specific districts, obviating the need to manage 435 labels at a variety of zoom depths. One day I got to spend an hour debugging why, for whatever reason, the tooltip was simply disappearing in Safari and IE. Turns out it was autosizing incorrectly--which kind of defeats the point of an "autosize" parameter.

Or how about this one: for no apparent reason, adding a TextField object to the display list of a sprite causes the bitmap filters to distort slightly. If you look closely at the Supreme Court graphic above, you'll notice that bars with text inside them (or next to them) are sometimes 1 pixel taller, seemingly because the GlowFilter being used to create an unscaled 1 pixel outline decided to be 1.5 pixels. The problem disappears if you zoom in. Why does this happen? Who knows?

Flash 10 includes some low-level improvements to text, which is a good start. But as far as I can tell, they primarily make working with fonts better within a single platform, and are aimed at people creating flexible layouts, like word-processing applications. People like me who work in graphic-intensive apps like data visualization and gaming are still probably out of luck.

Future - Present - Past