views:

102

answers:

1

Simple question - how is text-zooming implemented on an Android/iPhone device? Do they pre-compute frequently used bitmaps of a font and replace the text as the scale changes? Or do they extract the contours from the font files and render the text as vector graphics?

+1  A: 

Text rendering is a fairly complex subject so any answer here will just be glossing over a lot of stuff. Typefaces are generally stored in vector format, and not bitmaps. The system lays out the text by computing the metrics of each letter and creates a vector shape that is rendered into a bitmap that is displayed on the screen. It's unlikely that the system will cache the individual letterforms as bitmaps because of the way antialiasing and subpixel rendering works. But at some point all vector graphics are converted into bitmaps because the typical computer display is made up of pixels.

lucius
So, I knew most of that - I probably should have been more detailed in my question. Last time I checked, while you are zooming on the iPhone, the text blurs until you stop zooming. I'm guessing what happens is that the original bitmap is scaled until the zooming is stopped, at which point a new bitmap of the appropriate size is calculated.On Android 2.0, it does real-time scaling. No blurring. That's what I wanted to figure out - how? I'd be very surprised if it is creating new bitmaps on the fly as it scales, because that's a very expensive operation.
rcoyner