?
Solved

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

Posted on 2003-02-19
8
Medium Priority
?
389 Views
Last Modified: 2013-12-03
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
Comment
Question by:shankarkrupa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 3

Expert Comment

by:venyon
ID: 7984865
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
 
LVL 3

Author Comment

by:shankarkrupa
ID: 7984981
Does it mean that I can use the font without installing if it is included in a resource editor?
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 7984996
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
webJose earned 400 total points
ID: 7989224
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
 
LVL 3

Author Comment

by:shankarkrupa
ID: 7996867
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
 
LVL 7

Expert Comment

by:webJose
ID: 7997150
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
 
LVL 3

Author Comment

by:shankarkrupa
ID: 7997840
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
 
LVL 3

Author Comment

by:shankarkrupa
ID: 8047949
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question