Archived

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

OklyDokly

D3D8 Bitmap Text

Recommended Posts

Hi, I''ve seen on the web a few ideas for creating a text mapper class by grabbing a bitmap of all the characters of a certain font, stored in the system. However I have a couple of qualms about this method and am wondering if there is a better way of doing this. 1. For a decent text mapping class, you will probably have to add in lower, medium and higher resolution textures to accomodate for all possible font size. So for example you might have a 256x256 texture for point 12-20 fonts, 512x512 for 20-40 and 1024x1024 for >40. 2. You will also have to add a different texture into the class for each attribute you set for the font. For example if you wanted to allow the font to have bold, italic or underlined attributes then you will need a texture for all three, plus four more textures for all the possible combinations of the three, plus the original font texture. That''s 8 textures needed in this case. Combine this with a lo, medium and hi-res texture for each then you will need 24 different textures. There are many cases I can think of where such a method would be impratical in a D3D application, for example you might want to display html pages within the D3D application. I was wondering if anyone knows of a better method for displaying text in D3D applications?

Share this post


Link to post
Share on other sites
Yeah, I''ve looked at CD3DFont, but I have problems understanding it, the commenting in the microsoft code is awful. Also I don''t think the method in CD3DFont is very practical if it works exactly the way I explained, for the aforementioned reasons.

Share this post


Link to post
Share on other sites
OK, I''ve done a little more research and noticed that OpenGL has a wglUseFontOutlines function which would solve the problems I mentioned before. It would be quite easy to convert this to direct3D if I knew away to get the polygon structure of a font using the win32 API.

Does anyone know how to do this?

Share this post


Link to post
Share on other sites