AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Script for automatically installing fonts

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
happytodd



Joined: 12 Nov 2007
Posts: 142
Location: South Australia

PostPosted: Fri Dec 11, 2009 2:17 am    Post subject: Script for automatically installing fonts Reply with quote

Dear Users/Staff,
I have been making a program, and I want it to have a special font which most people don't have. I was just wondering if there was such a script to automatically install fonts to the C:\WINDOWS\Fonts directory. So when people download my program, they'll download the font which is in the zip file with my program, then it will automatically install to the directory once the application is open.

Not asking for actual script, just asking to be pointed in the right direction.

Thankyou,
Happytodd =]
_________________

Back to top
View user's profile Send private message Visit poster's website
entropic



Joined: 21 Dec 2008
Posts: 181

PostPosted: Fri Dec 11, 2009 3:26 am    Post subject: Reply with quote

It isn't an autohotkey solution (VBScript), it's installed by default in any Windows OS since 98.

http://blogs.technet.com/heyscriptingguy/archive/2008/04/25/how-can-i-install-fonts-using-a-script.aspx

Edit: Found an AHK solution courtesy of Serenity
http://www.autohotkey.com/forum/viewtopic.php?p=43981#43981
Back to top
View user's profile Send private message
happytodd



Joined: 12 Nov 2007
Posts: 142
Location: South Australia

PostPosted: Fri Dec 11, 2009 4:36 am    Post subject: Reply with quote

Thankyou,
I tried using the AHK one but no luck so far...
I downloaded a font folder that contains a "Font file" which is called VISITOR and I also got two "TrueType Font files" called visitor1, and visitor2. So I tried doing this:
Code:
font = visitor1.ttf ; font in %A_WorkingDir%

DllCall("GDI32.DLL\AddFontResource", str, font)
; msgbox, %errorlevel%

; send WM_FONTCHANGE to all windows:
SendMessage,  0x1D,,,, ahk_id 0xFFFF
sleep 10000

But it didn't work. So I tried applying it to an application I'm working on which I want this to work with, but still no luck. Can anyone please help me with getting this to work. Its really puzzling me >.<
Thankyou =]
_________________

Back to top
View user's profile Send private message Visit poster's website
happytodd



Joined: 12 Nov 2007
Posts: 142
Location: South Australia

PostPosted: Sun Dec 13, 2009 3:16 am    Post subject: Reply with quote

Bump Rolling Eyes
_________________

Back to top
View user's profile Send private message Visit poster's website
happytodd



Joined: 12 Nov 2007
Posts: 142
Location: South Australia

PostPosted: Tue Dec 15, 2009 5:00 am    Post subject: Reply with quote

Bump Rolling Eyes

I hope someone can help me out. Or would it be easier to just Filecopy?
I read somewhere that its hard to Filecopy a font because it'll duplicate the font or something. How would I go on about copying it instead? I want a way I can install a font without restarting my pc. I hope someone can help please =[
_________________

Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Tue Dec 15, 2009 7:22 am    Post subject: Reply with quote

The simplest way is to use Microsofts FontInst tool (~40k ) used by IE Installer.

http://www.autohotkey.com/forum/viewtopic.php?p=242050#242050
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group