PocketMatrix forums

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

CreateFont() issues

ten foot ninja · 18 Aug 2006, 17:45 UTC
Hello,
I'm trying to create my own font on Symbian and provide my own character string. My code is as follows:

Code:
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);
}


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 · 25 Aug 2006, 19:48 UTC
So there is nothing wrong with my code? there is a bug in the symbian library?
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
ten foot ninja · 02 Sep 2006, 20:25 UTC
Yup, starting with a space worked. Make sure not to have any 'white space' pixels on the left most edge.