Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

font surface issue


font surface issue

Postby bcj » Nov 24, 2009 @ 8:06pm

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.
bcj
bcj
pm Member
 
Posts: 18
Joined: Sep 23, 2009 @ 12:53pm
Location: hyd


Postby RapchikProgrammer » Nov 25, 2009 @ 10:33am

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: Select all









10 
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);
10 lines; 1 keywds; 4 nums; 24 ops; 2 strs; 3 coms    Syntactic Coloring v0.4 - Dan East  


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..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron