Optimizing Appearance of Bitmaps and Fonts

1/16/2009 11:21 PM
You can subscribe to this wiki article using an RSS feed reader.

Image and font distortion is a issue with some applications. For many existing applications it is an unavoidable problem: it is not possible to expand a bitmap by a factor of one-and-a-half without some distortion. But there are steps that a developer can take to make a StyleTap-powered application look as good as any native application on a Windows Mobile device, while still preserving 100% compatibility with Palm OS devices.

Graphical bitmaps

Older Palm OS applications include only single-density bitmaps, designed for 160x160 displays. Newer applications may include bitmap families for both single- and double-density (320x320 devices). When StyleTap runs such a program on a VGA (480x640) device, we take the single-density bitmap and expand it by a factor of three. That produces no distortion, but it certainly looks blocky. On a QVGA (240x320) device, we must expand the single-density bitmaps by 150%, which does produce a some distortion.

The solution is for application developers to add one-and-a-half-density bitmaps (for QVGA) and triple-density bitmaps (for VGA) to those bitmap families in the resources section of the .prc file. These bitmaps are displayed with perfect fidelity and are the right size on QVGA and VGA screens, respectively.

To create bitmap resources and bind them to into a .prc file, we use PilRC; we have patched it to support one-and-a-half- and triple-density bitmaps (and fonts...see below). We've submitted our patches to the open source group that maintains PilRC. A copy of the patched program is available in our Support Downloads section.

Note that although one-and-a-half- and triple-density display modes may sound odd, they are in fact part of the standard Palm OS high-density graphics APIs. It's just that Palm never shipped any devices that used those display densities. If you include these higher density resources in your application .prc, your application will still run as it always has on a Palm OS device, but it will also look much better on a StyleTap device.

Fonts

The font situation is similar. The Palm APIs allow you to define and use single-, double-, one-and-a-half- and triple-density fonts. StyleTap takes the best font that is available and expands it to the appropriate density. We have included one-and-a-half- and triple-density versions of all the standard fonts in our product.

If your application includes its own custom fonts, you may see the same kind of distortion as you do with bitmaps. You can use the modified version of PilRC to define your own custom fonts in any density. Again, you should provide one-and-a-half- and triple-density custom fonts to provide the optimal user experience on all devices that run StyleTap Platform.

We are continuing to improve the appearance of the standard fonts that are built into StyleTap Platform.