Index

Gallery

Faq

Bitmap Formatting

Source & Downloads

Small Walkthrough

Links & References

Contact





Version 0.06
2005/04/27











Do-it-yourself Raster Fonts for Symbian

The 'PixelFont' project listed here is intended to provide Symbian Series60/UIQ application programmers with an alternative and relative lightweight way to display custom text fonts in graphics oriented programs. This effort should be seen as a supplement to the rather minimalistic font pack that is delivered with a standard Series60 phone today. Note however that the framework fits any type of icon array style bitmaps, be it a font or something else. Its just for simplicity the graphics elements are called fonts throughout. The entire setup resembles what everybody else do in order to get some homemade font packs, including the commercial fullscale graphics api's listed in the link section with their font editors.

What is basically provided is a converter that will process a bitmap containing a costom font and produce a metafile which can then be deployed at runtime together with the initial bitmap itself. For the runtime a dll will allow you to generate text output with a slightly changed DrawText() variant in your program.

Please note that the two main aims with this project are :
- to provide a fast and simple way to get alternative fonts available for use by an application. For the simplest cases this means that it is possible to make a new font pack in just about no time, using Paint as the graphic editor and without using any other programs than those delivered with the project here.
- to be OS version and hardware independent from callers viewpoint, for instance with regard to display colour resolution and Symbian API usage.

Next thing to focus on is then performance and hence the technology available. For the future generations of Symbian then support for alpha blending, opacity control etc in bitmap manipulations has been introduced in the OS v7.0 graphics API (see links). Since this does not help all the Symbian OS v6.1 units out there then all bitmap manipulations are done so far as raw pixel banging. This is not good for performance but on the other hand there is no limit for functionalities that can be added by anyone that bothers to do the work.

Right now this means that there is opacity control, that there is support for alpha blending/anti-aliasing and that shadows (if designed into the graphics) can be displayed correctly.

This project is still in progress and the quality is still very much development quality. If you would like to contribute to the software then please send an email. If you unlike me have a talent for producing nice graphics, or perhaps even fonts, then you are most welcome as well.

Enjoy !



Small Walkthrough

The walkthrough consist of two parts, the design of a font and the runtime deployment of the font in an application. The real files used can be found under gallery as the graphics shown here are more or less webtized.

Design time :

Here follows a very simple text font showcased on a Series 60 phone. First a bitmap with the wanted characterset has to be produced, this could be in a dedicated graphics editor or even a simple screen capture from say a word processor screen or a browser. For the sake of this simple demo the wanted characters were written in PhotoShop. The font is a plain Geramond 9pt. Just to beef up things a little the text is made antialiased.

Original bitmap

Because of the antialiasing two bitmaps are needed, the color bitmap and a alpha bitmap. These are shown below. The first is now effectively a color information bitmap where all non-white pixels are made black. The single pixels to the far left are added to define the baselines, and a small horizontal line at upper left is a linkerline inserted to define the space character. More about bitmap formatting here.

Color bitmap, Demo.bmp

Alpha bitmap, DemoAlpha.bmp

The alpha bitmap is simply a copy of the original bitmap. The Demo.bmp and DemoAlpha.bmp bitmaps is now packaged in a Symbian style .mbm file that for no particular reason is given the name Demo.mbm.

A second file is needed before the mbm is ready for further processing and that's an reference file containing the character sequence used for the bitmaps above. This is a plain textfile with the extension .c8. You can see it here, Demo.c8. This is what allows the PixelFont::DrawText() method to figure out the correct characters to blit when given a string descriptor.

Now the .mbm file and the .c8 file are given to the BitmapFontConverter.Exe which from these can produce the Demo.Inf metafile containing all needed coordinates into the bitmap(s) as well as the reference characters from the .c8 file. This .inf file together with the .mbm file will allow the PixelFont.dll to show the font on target. The Demo.Inf file is binary by the way so a link is not given here. The following figure tries to show this :



Run time :

It is required that the graphics is done with an intermediate offscreen bitmap. If this is true then a container might now add the following line in order to start using the new Demo font :

iPixelFont = CPixelFont::NewL(_L("Demo"));

and in the Draw() method this line :

iPixelFont->DrawText(pnt,iCFbsBitmap,_L("!\"#$%%&'()*+,-./\\_"));

will now draw the text to the offscreen bitmap.

Here is a screendump from a S60 SDK 1.2 emulator using a white and colored background respectively :

This finalizes the walkthrough. The project PixelFontTextExe will per default build the colored demo seen to the right above.





Links & references

Windows freeware utility :
An impressive little screen capture program for windows : Meazure

Symbian OS & Series60/UIQ Official Stuff
Symbian OS 7.0 - Developer Library » API Reference » C++ API reference » 2D Graphics Hardware Acceleration : Symbian

Series 60 Platform 2nd Edition, Feature Pack 3 introduces scalable UI based on SVG tiny rather than bitmaps : Forum Nokia

Free software projects :
Here it is, an open source S60/Communicator application (a PuTTY) which without further ado loads X11 .gbd fonts with apparent ease and smoothness. Nice job all over. PuTTY at SourceForge

FrozenBubble for Series 60 has a compact font rendering class – FrozenBubble at SourceForge

For using the native Symbian font stuff www.newlc.com is always worth a try.

Full blown graphics frameworks for Symbian
Not small toy projects like PixelFont but rather the real works.

OpenGL ES 1.1, the Khronos project, will eventually get into Symbian :
Khronos Symbian Developer

2D cross-platform graphical library : GapiDraw