GLBasic forum

Main forum => Bug Reports => Topic started by: Neo-Bagamut on 2009-Nov-17

Title: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-17
Hello everybody.
Go excuse for my bad English, because I'm Russian.

Three days ago, began to study GLBasic (this is the first programming language that I study). And immediately ran into another problem:

CODE:
----------------------------------------------
scr$ = "Some text on russian"
na$ = "Some text on russian"
LOADFONT "1.bmp", 1
SETFONT 1
WHILE KEY(1)=0
  GETSCREENSIZE sx#, sy#
  PRINT scr$ + sx#+ na$ +sy#, 25,25
  SHOWSCREEN
WEND
END
---------------------------------------------------
GETSCREENSIZE comand displays 640x480, but my screen resolution is 1024x768! What is my mistake? Why the program does not display my real screen resolution?

My second problem is russian fonts. I created a font with "Font Creator" in GLBasic, save him as 1.bmp. But instead of Russian letters displayed various symbols and letters! What is my mistake?

Please help me with my two little problems. Thanks!
Title: Re: GETSCREENSIZE and FONT problems
Post by: Quentin on 2009-Nov-17
First of all! Welcome :)

GETSCREENSIZE will deliver the size of the current window, not your desktop resolution. By default the window size is set to 640x480 unless you change in your project settings or by the SETSCREEN command.
Title: Re: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-17
Is there a GLBasic command reads the monitor mode support?
Title: Re: GETSCREENSIZE and FONT problems
Post by: Kitty Hello on 2009-Nov-17
Well, there is an INLINE solution:
http://www.glbasic.com/forum/index.php?topic=961.msg4965#msg4965 (http://www.glbasic.com/forum/index.php?topic=961.msg4965#msg4965)
Title: Re: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-17
Thanks Kitty Hello, for very helpful post

QuoteWell, there is an INLINE solution:
http://www.glbasic.com/forum/index.php?topic=961.msg4965#msg4965 (http://www.glbasic.com/forum/index.php?topic=961.msg4965#msg4965)

I would like to know more about fonts, more precisely about the support of Russian letters!
Title: Re: GETSCREENSIZE and FONT problems
Post by: Quentin on 2009-Nov-17
I think it would be a good idea if you post the bmp file with the font (as an attachment).
Title: Re: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-17
QuoteI think it would be a good idea if you post the bmp file with the font (as an attachment).
(http://pic.ipicture.ru/uploads/091117/gT1RD4pCMH.jpg)
Title: Re: GETSCREENSIZE and FONT problems
Post by: Quentin on 2009-Nov-17
the font looks ok for me. What about a small code snippet to demonstrate the failure?
Title: Re: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-17
CODE:
------------------------------------------
LOADFONT "1.bmp", 1
SETFONT 1
WHILE KEY(1)=0
  GETSCREENSIZE sx#, sy#
  PRINT "ПÃ'â,¬ÃÂ¸ÃÂ²ÃÂµÃ'‚ миÃ'â,¬!", 25,25
  SHOWSCREEN
WEND
END
------------------------------------------

SCREENSHOT:
(http://pic.ipicture.ru/uploads/091118/d2x7Vsv34K.png)
Title: Re: GETSCREENSIZE and FONT problems
Post by: Kitty Hello on 2009-Nov-17
I can't copy/paste these characters. What do you get when you do this:

Code (glbasic) Select

a$ =" ПÃ'â,¬ÃÂ¸ÃÂ²ÃÂµÃ'‚ миÃ'â,¬!"
FOR i=0 TO LEN(a$)
   DEBUG ASC(MID$(a$,i,1)+", "
NEXT
DEBUG "\n"

(turn debug mode on)
Title: Re: GETSCREENSIZE and FONT problems
Post by: Neo-Bagamut on 2009-Nov-18
Then i run this code in debug mode

CODE:
---------------------------------------
a$ =" ПÃ'â,¬ÃÂ¸ÃÂ²ÃÂµÃ'‚ миÃ'â,¬!"
FOR i=0 TO LEN(a$)
   DEBUG ASC(MID$(a$,i,1)+", "   // <----- syntax error
NEXT
DEBUG "\n"
---------------------------------------
Displayed "syntax error"
Title: Re: GETSCREENSIZE and FONT problems
Post by: Quentin on 2009-Nov-18
a closing bracket is missing

try:  DEBUG ASC(MID$(a$,i,1))+", "