borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (timer)Next Topic (save data into a text file?) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Fonts Solved Topic
Poster Message
millerdraft
Level: Scholar

Registered: 01-02-2003
Posts: 41

icon Fonts

I am making a program that will be using a specific font that most people will not have on their computers.  Is there a way that I can embed that font into program file?  I would like not to install the font onto each persons computer.  If there is a way please let me know.  Thanks in advance.

Ted

____________________________
Ted Moe
I wish I was real good at this stuff!

02-09-2003 at 06:09 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Fonts

As I know, you must install font that your program is using in order windows to 'recognize' it. If u dont know how to do it using VB, post again and I will send u the code.

____________________________
If you find the answer helpful, please mark this topic as solved.

03-09-2003 at 12:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: Fonts

hehehe.... her i come!  

then for the labels, just use pictures of the labels in the font you want and use pictures instead. =)

otherwise, you'd have to install them in each pc using your program.

making them gif files are just tedious.. any reason why you don't want to share it?

____________________________
Been busy trying to take a second degree <--it's not working out...

03-09-2003 at 05:40 AM
View Profile Send Email to User Show All Posts | Quote Reply
millerdraft
Level: Scholar

Registered: 01-02-2003
Posts: 41
icon Re: Fonts

Thanks guys for all the help.  I did decide that I would go with image files even though that is getting boring doing everything.  It isn't that I don't want to share the font it is that the computers that it would be going on are customers of the ISP I work for and making it as easy as possible with out confusing them is the best way to go.  

Thanks again for the help.

Ted

____________________________
Ted Moe
I wish I was real good at this stuff!

03-09-2003 at 12:07 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
gw1
Level: Trainee

Registered: 16-03-2006
Posts: 2
icon Re: Fonts

Goran, please show me the VB code to install a font  thanks

16-03-2006 at 05:42 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Fonts

Basically, you would need to copy fonts you want to install to Fonts folder, which is located in %Windows% directory. Then you will use this API's (first one is for registering and 2nd one for unregistering)

Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long

' example to register font
AddFontResource "fontname.ttf"


____________________________
If you find the answer helpful, please mark this topic as solved.

16-03-2006 at 08:57 AM
View Profile Send Email to User Show All Posts | Quote Reply
gw1
Level: Trainee

Registered: 16-03-2006
Posts: 2
icon Re: Fonts

Thanks for your prompt reply. I read somewhere that addfontresource only adds the font temporarily, until the computer is restarted - do you know if this is correct?

16-03-2006 at 09:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Fonts

It worked fine with me.... Again, it shouldnt be hard to check that statement, run AddFontResource, restart the PC, and try to use them again.

____________________________
If you find the answer helpful, please mark this topic as solved.

21-03-2006 at 12:57 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Fonts

Just to add, I used AddFontResource when I was creating installation with Package And Deployment Wizard, sine there was no other way I knew of to install fonts. Now I use Visual Studio Installer, and iy does the job for you with installing fonts, so you dont need to worry about it. My bet is that VSI uses AddFontResource too.

____________________________
If you find the answer helpful, please mark this topic as solved.

21-03-2006 at 01:02 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Fonts Solved Topic
Previous Topic (timer)Next Topic (save data into a text file?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder