|
Index
Version
0.06
|
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 : 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 !
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.
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. 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.
Windows freeware utility : Symbian OS & Series60/UIQ
Official Stuff Free software projects : For using the native Symbian font stuff www.newlc.com is always worth a try. Full blown graphics frameworks
for Symbian
|