• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

simulator

Font Blitters- the only way????????

13 posts in this topic

Hi All :-) I have a silly but serious newbie question concerning font blitters (chopping up bitmaps to write text): Are font blitters really the only way to write text to a directdraw surface??? Any other, more direct or "built in" approaches??- ie: set the font/color/size and that''s it??? Ive scanned the win32 and directx sdk''s and can''t find anything. Yikes!!! If font blitters are really what''s used, is there anywhere I can download pre-packages ones: ie: with different font style bitmaps and lots more features than I would ever program myself?? (I''m sure no one but font specialists focus on font blitters in great depth?????) Thanx, I am really curious about this.... I''d be happy for any info.
0

Share this post


Link to post
Share on other sites
There is of course a ton of Windows API functions for drawing text and creating fonts, but for a game font blitters are best because the GDI is painfully slow. If you must use GDI functions, look up CreateFont, DeleteObject, TextOut, and DrawText. Be careful about memory leaks when using different fonts.

I would still recommend writing your own font blitter. It really isn't all that difficult. To use your own font blitter in DirectDraw, just make a bitmap of all the characters of the font you want to use (not very hard, just takes a while), then load them onto a surface somewhere. Then have your own text function which your program can pass a string of text to. Then, in your text function, just loop through each character of string, a blit the appropriate character based on the ASCII value of that character. To change the color of your font, you'd use a destination color key. Trust me, it takes a while, but it is very rewarding when you finish your own font engine. Plus you won't get slowed down by GDI.

Edited by - Midnight Coder on July 28, 2001 1:48:06 PM
0

Share this post


Link to post
Share on other sites
DirectX 8 has the ID3DXFont interface. Look it up in the help under the Direct3DX reference. I posted a reply about how to use this interface a couple days ago.

It is slower than a font blitter, but if you don''t use much text onscreen, it is definitely easier than writing a whole font system of your own.
0

Share this post


Link to post
Share on other sites
I aggree with Midnight Coder.

I have just realised (a few days ago) that I can´t rely on windows doing my text. I is VERY slow...

I knew it would not be lightning fast but just how slow it is has surprised me. I now have to make my own font blitting using DirectDraw blt instead.

I am doing a 2D map editor in DirectDraw at the moment. It´s runing in 1024x768.
When printing text using GDI the framerate is 37. Without text it is 75 (max refreshrate of my monitor).

My machine is a Thunderbird 1000mhz and GeForce 3





0

Share this post


Link to post
Share on other sites
Hey thanx for the replys- amazing speed difference! Right now, gdi is out coz I don't even know how to incorperate it into a directx application (im following the online tutorial here). Also, im on windows NT so directx8 is also out.

But still!!!!!!!!!! Im a programmer not an artist. Sure if I want a simple constant-spaced courier style font its an okay task- but I like nice fonts & lots of them- making these in photoshop and then chopping them up etc (as in the online tutorial) well- their character spacing varies in a way I dont know (am i supposed to measure it??) and also, there's italics and bold etc- and even copyright issues perhaps....

Perhaps im lazy- but geesh- there must be really nice "font engines" out there??? Does anyone know of one???? Hey and if they don't exist- hahaha maybe I'll build one and make loads of $$$- Would you buy one??


ps: it would be interesting to see a similar speed comparison between font blitting and the directx 8.0 ID3DXFont interface functions

Edited by - simulator on July 28, 2001 3:25:14 PM
0

Share this post


Link to post
Share on other sites
Hey

I searched the archives here & found GameFontDX at
http://maginusorb.dhs.org/gamefont/about.htm
& its free!! Havent used it yet?? Any opinions on it?
0

Share this post


Link to post
Share on other sites
I just wrote a font generator program which takes a windows font and converts it into a bmp file, and records the offsets of each character in a separate file. You can have the source, or just the program if you want. Email me at lee@mazurek.net if anyone wants.
0

Share this post


Link to post
Share on other sites
Hey Dog_Food..!!!

I could use that too....Please send it to me...

dsl26132@vip.cybercity.dk

I would like to look at the source too....


0

Share this post


Link to post
Share on other sites
quote:

Right now, gdi is out coz I don''t even know how to incorperate it into a directx application.



I can give you some code if you really want it...?
0

Share this post


Link to post
Share on other sites
Hey Dog-food thanx! I''ll email you now. This GameFontDX is, ummm, not really obvious for me..... so thanx
0

Share this post


Link to post
Share on other sites
Hi granat- that would be great - ive been curious about how to do that.Thanx.

You guys are so helpful!! This forum is great
I''ll try to write a generalized blitting function to read in dog-food''s output- if it works, I''ll post it here.

Thanx
0

Share this post


Link to post
Share on other sites
Although I am hesitant to post code online (code for other people must meet a higher standard of quality), here is a link to the bitmap font generator.
http://www.mazurek.net/lee/fontgen.zip

(Sorry, would have made html link but that didn't work and screwed up page formatting)

Edited by - Dog_Food on July 28, 2001 9:51:49 PM
0

Share this post


Link to post
Share on other sites
Hey Granat thank you- I got it working after a little tweaking!!!

And Dog-food thank you- I''ll download it now & no worries- I don''t mind imperfect code- that''s actually how I learn
0

Share this post


Link to post
Share on other sites