User::Leave

BitmapFormatting



Do-it-yourself Raster Fonts for Symbian


Bitmap Formatting

This page is not complete yet !!!!!

This page shows the optional markers that can be manually added to a bitmap before a conversion. They can help in two different ways, they can force the converter to produce some usefull metrics for aligments and they can prevent misinterpretations of the shapes of the graphic sub-elements.
The following figure shows a simple bitmap where the black pixels are the originals and where the red marker pixels have been added afterwards. (The color of the markers doesn't matter, they could be black as well)


Upper left pixel has the coodinates (0,0).

OffColor

The point (0,0) is used to define the transparent backgroundcolor, also called the OffColor. Per definition then all other colors will then be OnColors. This is the first point decoded since this information is required to figure out if a marker is on or off in the following.

Row Entity

The example consists of two row entities, [(space) ! ”] and [0 1 2], and the .c8 file will then have to contain the 6 characters [ !”012]. The possibility for multiple row entities is only made because it allows the bitmap to be more handy to work with. Since the bitmap in this example is so small it would normally not make sense to break it into two lines as done here – especially as this in itself tends to complicate matters a little.

Parsing a bitmap

The first pass by the converter is vertically from top to bottom in order to resolve the number of row entities and their vertical metrics (upper and lower coordinates, baseline etc). On second pass each row entity is parsed horizontally from left to right establishing the metrics for each individual character, or element (left and right coordinates etc).

Baseline

The first row from (0,1) and downwards (i.e. row 0 except for the first pixel) is always allocated for optional baseline markers and/or linkermarkers. Whenever a graphics row entity is considered to start the first marker before the end is reached is considered to be the baseline marker. If an additional marker is found before the next graphics row entity start then this is a linkerline belonging to the one above. (The criteria is that it must be a single row with at least a single empty row above and below).
If no baseline marker is found then the baseline will be set to the row bottom.

Linkerline

A linkerline is a horizontal keep-going line, here there are one for the space character and one that ensures that the “ character will be treated as a single character.

Header

The header is optional, its existence is defined by a mark in (2,0). Curently not used for anything.

Keepgoing

A dot in (1,0) tells that column 1 is a keepgoing column. This is the vertical version of the linkerline. Here it ensures that the ! will be treated as a single character. It can also be used to define the top and bottom for a row entity if it extends the actual graphical elements.

Row entity metrics and vertical alignment

The figure below shows how the result of the first vertical pass looks like in terms of detecting row entities. As can be seen, then the manually placed baseline markers to the far left are the only ones usefull for vertical alignment of a text since both row entities have different top and bottom metrics relative to the characters they contain. The neatest fix to this would be not to use multiple rows at all. If it is unacceptable that the only way to align vertically align is by baseline alignment, then there should have been two equal keepgoing lines for the two rows.



Kerning

A more accurate term would be 'auto-kerning' since the metrics for kerning are automatically found during the conversion process. (This is not the way true kerning works). The amount of kerning, if any, can be set through the PixelFont API (through trial and error !). Since the kerning stuff is rather experimental it is not described further for now.......