Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

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...

krupa
0
shankarkrupa
Asked:
shankarkrupa
  • 5
  • 2
1 Solution
 
venyonCommented:
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.
0
 
shankarkrupaAuthor Commented:
Does it mean that I can use the font without installing if it is included in a resource editor?
0
 
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?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
webJoseCommented:
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.
0
 
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?

Eagerly,
krupa
0
 
webJoseCommented:
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.
0
 
shankarkrupaAuthor Commented:
Hello webjose....

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

---------------------------------------------------------
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?  

Krupa



0
 
shankarkrupaAuthor Commented:
Thanks webjose...

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

venyon....

Please click here and comment for your points.

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20534718.html

Thanksfully,
krupa
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now