Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb6 add font files to user's PC (C:\Windows\Fonts)

Status
Not open for further replies.

ampwar4

Programmer
Joined
Jan 10, 2009
Messages
1
Location
US
Hi All,
I wrote a small application for a differnt group of users and I was surprised to find that if a PC did not have the font I used in preparing my text, the user's machine would choose a font. Then, that font's size would overflow a label or control.
Is it possible to add a font file to my application and then have it install into a user's "C:\Windows\Fonts" directory so that the font would then be usable to the application?
I have read that Vista does not allow direct file inputs without going through the registry. If this is true, could someone help me with code to accomplish this?

Any suggestions will be greatly appreciated.
Ampwar4
(Dwight)

"The only history we can change is that which lies ahead."

 
Easiest solution is to use a standard Windows font in your app. Saves all the expense of buying licenses to use other fonts.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Generally you'll want to set your program's fonts at runtime to the system UI font anyway for consistency. VB6's default of MS Sans Serif is getting a bit long in the tooth, being a fairly ratty looking raster font.

The system default went to Tahoma about when Win2K came out, and changed to Segoe UI starting with Vista. I just use a drop in Class now to detect and apply the system font to anything left at MS Sans Serif.
 
>that if a PC did not have the font I used in preparing my text, the user's machine would choose a font

It is worth explaining that 'se;ecting' a font in Windows is actually more a case of suggesting a font. Basically you suggest to Windows the details of a font you'd like to use, and Windows finds what it thinks is the closest possible match ...

Anyway, as johnwm says, you are best off electing to use one of the standard fonts that comes with Windows. Many fonts are not allowed to be legally redistributed and for those that are you normally have to pay a (generally pricey) licence fee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top