🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Resources

Started by
5 comments, last by Ranok 24 years, 7 months ago
I don't know for sure, but in Andre Lamothe's new book he says it is a big pain in the behind. I think he said look it up in your Win32 API and didn't really cover it much.(About the only thing he didn't cover in this volume)I'd be interested myself though.

------------------
Still Learning...

Still Learning...
Advertisement
I have a few ideas but the main problem is the windows font functions only use the font's in the Windows\font directory I can't access them from anywere else.

So if anyone know how to access windows font else were on the hard disk no problem?

Other wise if you create you own font handler for BMP font's then you can include that as a resource and access the data directly as binary or a BMP.

Well, you probably need to take a look at the help files regarding LOGFONT and the GDI version of DrawText, which is the non-MFC way of doing things text-related. Your font is held in your device context (CDC).

I will warn you that this isn't going to be easy though, and you're going to have to be really careful to ensure that your text routines will work on all systems.

Luck.... "Here there be dragons".

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Took a look at LOGFONT data structure which is used with CreateFontIndirect() which from what I can see is just anouther way of performing the same task as CreateFont().

Thanks for taking a look

For my needs I want to access a font from a resource or file external to the system so if the application crash's or is terminated the font is not left on the system.

I think I will end up creating a bitmap font class which is perfect for my needs and then keep the data as a resource.

Well, you're going to have to use the windows font table regardless, but you can use AddFontResource to get your super-spiffy special font into the system font table.

Then continue as noted above.

It's probably nice of you to clean up by calling RemoveFontResource, though if you crash this will be a little hard. It works for termination though.

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
I was wandering how you would go about loading a file from a resource without using MFC. What I am trying to do is load a font file out of the resource and use it to diplay fonts in DirectX. Does anybody know how to do this?
---Ranok---
I think that I will end up creating my own bitmap fonst also( this way I can do alpha blending also ), but it would still be usefull to load the font from a resource or an external file. Thanks for ideas, though.

[This message has been edited by Ranok (edited November 04, 1999).]

---Ranok---

This topic is closed to new replies.

Advertisement