PocketMatrix forums

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

Problems with DrawText

Pejo Software - Per · 10 May 2003, 17:03 UTC
I started porting my game from version 1.04 to version 2.01. It was painless and I got the game up and running in 5 minutes and then I noticed that some texts didn't show up.
It was those text that wasn't aligned to the left (using GDDRAWTEXT_CENTER and GDDRAWTEXT_RIGHT).

Bug or feature?
Pejo Software - Per · 10 May 2003, 18:17 UTC
Additional information: I was running the smartphone emulator.
Pejo Software - Per · 11 May 2003, 22:35 UTC
I also have problem with the following:
Code:
m_backbuffer.DrawText(35,50,_T("Sound"),&m_fontComicSans,GDBLTFAST_KEYSRC|GDBLTFAST_COLORFILL,GDDRAWTEXT_LEFT,&GDBltFastFx,0);
The text starts about 15 pixels to the left of the corresponding:
Code:
m_backbuffer.DrawText(35,50,_T("Sound"),&m_fontComicSans,0,GDDRAWTEXT_LEFT,0,0);
I'll have a look...
Apparantly GapiDraw 2.0 now is a little bit picker with the fonts (it will fail even if the font is slightly wrong).. I believe the issue is with your font and not the GapiDraw rendering system.

Issue#1 - invisible font
This has been reported by others and it is probably related to the font.

Issue#2 - ?
The second issue you mentioned (posted 11:35) really makes no sense.. It is basically impossible since the flags are simply passed in the final blit - all coordinates are generated in advance... This was an odd one... Perhaps the font has something to do with it...
Pejo Software - Per · 13 May 2003, 07:41 UTC
sbl wrote:It is basically impossible
Never heard that one before :wink:.
I dont't think there is anything "wrong" with my font. It was created with fontmaker. So if it isn't a bug in fontmaker then....
But since no one else seems to have the problems I have it might be something wrong elsewhere in my code (Maybe I am writing over memory I shouldn't). I am not using GapiApplication and that might be a source of problems or maybe I am not setting up the font correctly.

And...
Pucken var alldrig inne!
FontMaker has problems with various fonts and sizes. Some of the TrueType Chancery fonts produce results that GapiDraw 1.04 refuses to use at all. This usually occurs with smaller more slanted font styles.
Pejo Software - Per · 13 May 2003, 19:45 UTC
I could not find anything wrong with my font.
So inspired by Stuff i modified the minimal application and the problems occurs there too (tested with Pocket PC 2002 emulator).

Maybe someone (Johan?) could take a look at it out and tell me what is wrong:
http://www.pejosoftware.com/Minimal_DrawText_Problem.zip
Thanks a lot! I'll look into it...
Ok,

User error number one:
----------------------

backbuffer.DrawText(35,70,_T("Misaligned"),&m_fontComicSans,GDBLTFAST_KEYSRC|GDBLTFAST_COLORFILL,GDDRAWTEXT_LEFT,&GDBltFastFx,0);

Should actually be:

backbuffer.DrawText(35,70,_T("Misaligned"),&m_fontComicSans,GDDRAWTEXT_LEFT,GDBLTFAST_KEYSRC|GDBLTFAST_COLORFILL,&GDBltFastFx,0);

User error number two:
----------------------

backbuffer.DrawText(120,100,_T("This text doesn't show"),&m_fontComicSans,0,GDDRAWTEXT_CENTER,0,0);

should be

backbuffer.DrawText(120,100,_T("This text doesn't show"),&m_fontComicSans,GDDRAWTEXT_CENTER,0,0,0);

Check the docs.. Text flags first, then bltfastflags.. Then you'll get the color fill to work... No bugs here.. :)
Pejo Software - Per · 14 May 2003, 13:57 UTC
Oh :oops:
Thanks a lot!