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?

CreateFont() issues


CreateFont() issues

Postby ten foot ninja » Aug 18, 2006 @ 6:45pm

Hello,
I'm trying to create my own font on Symbian and provide my own character string. My code is as follows:

Code: Select all









10 
11 
12 
13 
14 
menuFont->CreateSurface( GDSURFACE_SYSTEMMEMORY, mbmName, EMbmMenufont );


GDFONTFX fontfx;
fontfx.lTracking = 0;
HRESULT result=0;

_TCHAR fontChars[] = {_T("0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZÁ|£ÉÍ%Ó&:(Ú_Ý>=!?.,'-*abcdefghijklmnopqrstuvwxyzá~[é{í@ó;^<ú`ý+")};

//_TCHAR fontChars[] = {_T(" !\"#$%&'()*+,-./0123456789:;<=>?@ ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~_")};

if ( result = menuFont->CreateFont(fontChars, RGB(255, 0, 255), GDCREATEFONT_TRACKING, &fontfx) != GD_OK ) {
    _ASSERT(false);
}
14 lines; 2 keywds; 5 nums; 43 ops; 1 strs; 1 coms    Syntactic Coloring v0.4 - Dan East  


and everytime, the call to CreateFont() fails (for reasons other than those in the docs). if, however, i use the default string (commented out above) it works.

And whats more, it doesn't seem to use the font bmp i provided, it shows characters i haven't defined in the bmp font file. As if it is by passing my font surface and using some default font

This only happens with symbian, when i run it on Win32, everything works wonderfully. Anyone got any hints/ideas?

Thanks in advance!
ten foot ninja
pm Member
 
Posts: 19
Joined: Nov 6, 2005 @ 11:21pm


Postby ten foot ninja » Aug 25, 2006 @ 8:48pm

So there is nothing wrong with my code? there is a bug in the symbian library?
ten foot ninja
pm Member
 
Posts: 19
Joined: Nov 6, 2005 @ 11:21pm


Postby Johan » Aug 25, 2006 @ 10:26pm

Hm. Maybe you can try to just replace a few characters at the time? Maybe just start with changing one character at a time to see if it's one of the character codes it has issues with?

Also, the default string begins with a space. Can you try using that format also?

//Johan
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[http://www.gapidraw.com]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby ten foot ninja » Sep 2, 2006 @ 9:25pm

Yup, starting with a space worked. Make sure not to have any 'white space' pixels on the left most edge.
ten foot ninja
pm Member
 
Posts: 19
Joined: Nov 6, 2005 @ 11:21pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

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