Page 1 of 1

Problems with DrawText

PostPosted: May 10, 2003 @ 6:03pm
by Pejo Software - Per
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?

PostPosted: May 10, 2003 @ 7:17pm
by Pejo Software - Per

PostPosted: May 11, 2003 @ 11:35pm
by Pejo Software - Per

PostPosted: May 12, 2003 @ 8:59am
by Johan
I'll have a look...

PostPosted: May 12, 2003 @ 1:45pm
by Johan
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...

PostPosted: May 13, 2003 @ 8:41am
by Pejo Software - Per

PostPosted: May 13, 2003 @ 1:04pm
by ppcStudios
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.

PostPosted: May 13, 2003 @ 8:45pm
by Pejo Software - Per
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:

PostPosted: May 14, 2003 @ 10:29am
by Johan
Thanks a lot! I'll look into it...

PostPosted: May 14, 2003 @ 10:38am
by Johan
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.. :)

PostPosted: May 14, 2003 @ 2:57pm
by Pejo Software - Per
Oh :oops:
Thanks a lot!