PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

font surface issue

hi
In my application i want to diaplsy some font using font surface. i am using font image of Blaster game and its looking very small , in my application of 640X480 emulator screen. so i try to increase the font surface using 'makefont' and 'fontmaker' tools and created new font image but while displying the fonts are not displaying properly.

the cahracters in the font image are wrrappeed over one another and not dispalying properly, and some times displayed as black rectangle box .

Can any body tell me the reason for this and give some guidelines ,how to create font surface and and the way to correctly display them.
RapchikProgrammer · 25 Nov 2009, 09:33 UTC
I never got the font creator tool to work myself.. but this is how edgelib works.. make a font file with all the characters you need like " abcdefg" etc into one bitmap.. and make a 1 pixel white border on top of each character.. that is if you have 'a' youll need to make a 1 pixel width line on top of it underwhich the entire character stays.. as a reference image i have uploaded a bit of my font file:

Image

it looks so bad because i have upsized it to show clearly what i mean..

make all the characters like this and have a 1 colour background color key, i use magenta (255,0,255 ).. now add these line according to your needs:

Code:

display->CreateSurface(&font;,"Font.png");

// Tell edgelib what characters we have in the file
font.SetFontCharacterSet(" abcdefghijklmnopqrstuvwxyz10+");

// Build font with 255,0,255 colorkey
font.BuildFont(true, E_RGBX(255,0,255));

// Set padding between characters, for proper spacing
font.SetFontPadding(1);


remember the font file is case sensitive, so setting the character list "abc" and trying to display "Abc" will only show " bc"..

one more tip create a space by making a white 1 pixel line over a blank area..

hope this helps..