Fonts Explaned In English Please
Ok. I wanna make a GUI where there are things like labels, textboxes, command buttons, etc. Can I use Windows fonts or am I better off doing it some other way? I''m totally confused. I''m aiming for an interface like Battle.net or Starcraft. Thanx
Download Complete. "YESSSSSS! The DirectX 7 SDK is finally MINE!! After 3 days of waiting, I have finally successfully downloaded this huge file. Now, I'll just fire up Winzip and... Illegal Fault. CURSES, MICROSOFT, CURSES!"
C:DOSC:DOSRUNRUN DOSRUN
Yes you can use Windows text functions (TextOut, DrawText etc.) to output text to the user. However, it's quite a bit slower than you could do by implementing it using your own bitmap font. If you are planning on using alot of text and speed is a critical issue you might wan't to consider using bitmaps, also bitmaps can add some extra eyecandy that Windows fonts can not. There's an article on how to do it using Windows right here (http://www.gamedev.net/reference/programming/features/fontengine). Briefly all you need is:
"I think, therefore I am...I think"
Edited by - Staffan on 3/19/00 12:28:45 PM
Edited by - Staffan on 3/19/00 12:29:49 PM
HFONT fnt = CreateFont(16,0,0,0,0,0,0,0,0,0,0,0,0, "Times New Roman");
lpdds->GetDC(&dc);
// SetBkMode, SetTextColor etc.
SelectObject(dc, fnt);
DrawText(...);
lpdds->ReleaseDC(dc);
"I think, therefore I am...I think"
Edited by - Staffan on 3/19/00 12:28:45 PM
Edited by - Staffan on 3/19/00 12:29:49 PM
Another thing, if you''re in the beginning of development you might wan''t to focus on the window management before you start thinking about textboxes
. How are you going to handle z-order?
"I think, therefore I am...I think"

"I think, therefore I am...I think"
I think it would be a lot easier if you were to use actual windows from the OS instead of making your own. See Half-Life.
So if I use my own font, would that mean making a bitmap with every letter and number and blitting from that bitmap? Sounds a little tough.
Also, if I use the first method with a gdi call to creating fonts, can I use all the fonts on my computer? If so, does the user have to have the font as well?
Download Complete. "YESSSSSS! The DirectX 7 SDK is finally MINE!! After 3 days of waiting, I have finally successfully downloaded this huge file. Now, I'll just fire up Winzip and... Illegal Fault. CURSES, MICROSOFT, CURSES!"
Edited by - Ronald Forbes on 3/19/00 2:43:51 PM
Also, if I use the first method with a gdi call to creating fonts, can I use all the fonts on my computer? If so, does the user have to have the font as well?
Download Complete. "YESSSSSS! The DirectX 7 SDK is finally MINE!! After 3 days of waiting, I have finally successfully downloaded this huge file. Now, I'll just fire up Winzip and... Illegal Fault. CURSES, MICROSOFT, CURSES!"
Edited by - Ronald Forbes on 3/19/00 2:43:51 PM
C:DOSC:DOSRUNRUN DOSRUN
Yes you will be able to use all the installed fonts on your computer. I heard there is a way to get it working without the font being installed, I don''t know how though.
As for bitmap fonts, it isn''t really that tough. Especially if you plan on using fixed width fonts, then it''s even easier. You could store the characters positions in an array or rectangles, and if you need non-fixed width font you would just add width to that.
The tricky part isn''t really the text...it''s everything else that comes with a GUI. If you wan''t some source code don''t hesitate on asking
. I have a basic and probably very buggy GUI I developed during this weekend, nothing special but it works, I''d be happy to give away.
"I think, therefore I am...I think"
As for bitmap fonts, it isn''t really that tough. Especially if you plan on using fixed width fonts, then it''s even easier. You could store the characters positions in an array or rectangles, and if you need non-fixed width font you would just add width to that.
The tricky part isn''t really the text...it''s everything else that comes with a GUI. If you wan''t some source code don''t hesitate on asking

"I think, therefore I am...I think"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement