Dynamic fonts in an exe file....!!!

Is it possible to use a font in an exe file without installing the particularl font in the system?  Like, the user can see all the text content in a textbox using that particular font without installing it in the $windows/fonts directory....

Something like the .eot files being used with internet explorer.  Is it possible to do it in VB also?

If I include the font with a resource file, can it be used to display letters?  If so, how?

Eagerly looking for any solution...

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can put all those fonts into your resource file using a resource editor (Add-In). if you're using VB6, simply look under the Add-In menu, Add-in manager. You can get it from the MSDN site as well if you're using earlier versions of VB.

Just be reminded that your resource file will get included into your exe file and thus loaded into memory. If you have huge fonts or a lot of them, it can cause your exe file to blot up. There's also the legal stuff about distribution of font files too.
shankarkrupaAuthor Commented:
Does it mean that I can use the font without installing if it is included in a resource editor?
shankarkrupaAuthor Commented:
If so, how?

How do I actually set the font name of the textbox to that particular font name of the resource file.

Obviously, I cannot simpley say text1.font.name="myfont", for it is not there in the font directory..........how else can I do it?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

You can use AddFontResourceEx API function(http://msdn.microsoft.com/library/en-us/gdi/fontext_214o.asp), or maybe AddFontMemResourceEx (http://msdn.microsoft.com/library/en-us/gdi/fontext_23zs.asp).  I have never done it before, so I cannot guide you further, but I believe these functions are the ones you need.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shankarkrupaAuthor Commented:
hello webjose....

I appreciate your help...thanks.

But what I am looking for is not a platform specific solution (well, at least able to do in all win32s)....

Is there some way I can use a font that is embeded with the resource file?

Can't it really be done....?  If we can do it in Internet Explorer (dynamic web fonts), won't we be able to do it in visual basic?

I don't understand.  The functions above do the trick for Win32.  All you have to do is use them!  It must work ok under VB.
shankarkrupaAuthor Commented:
Hello webjose....

This is what I saw under the heading requirements...

  Windows NT/2000/XP: Included in Windows 2000 and later.
  Windows 95/98/Me: Unsupported.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.
  Unicode: Implemented as Unicode and ANSI versions.

So, it is not supported for windows 98, etc. , is not it?  


shankarkrupaAuthor Commented:
Thanks webjose...

Though I could not use addfontresourceex, I am able to use the addfontresource function ...it works great.  thanks.


Please click here and comment for your points.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.