spyrorocks Posted May 7, 2006 Share Posted May 7, 2006 OK, here is a function that will install a font that you specify...Requirements: Autoit v3Parimeters:1. Path To Font FileReturns:0 = Failure1 = Success2 = Font Already Exists@error:1 = Failure2 = Not A Font File-1 = Invalid Path To FontfileExample:msgbox(0, "Font Manager", installfont("NEUROPOL.ttf"))Function:#include <file.au3> func installfont($file) ; Font Function By Spyrorocks dim $drive,$dir,$fname,$ext if not fileexists($file) then seterror(-1) return 0 endif $path = _PathSplit($file, $drive, $dir, $fname, $ext) if not $path[4] = "ttf" then if not $path[4] = "fon" then seterror(2) return 0 endif endif if fileexists(@WindowsDir & "\Fonts\" & $path[3] & $path[4]) then return 2 if filecopy($file, @WindowsDir & "\Fonts\" & $path[3] & $path[4]) = 0 then seterror(1) return 0 endif return 1 endfuncSo, any comments or ideas? [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
PezoFaSho Posted May 7, 2006 Share Posted May 7, 2006 nice i will probally use this alot. www.dafont.com has alot of cool fonts. I always waste time doing i by hand whenever im installing a new font to use for Photoshop. But thx for the program!!! 50% of the time, it works all the time Link to comment Share on other sites More sharing options...
RazerM Posted May 7, 2006 Share Posted May 7, 2006 could be useful if you want to use a custom font in a gui, Because you can install it with this My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Valuater Posted May 7, 2006 Share Posted May 7, 2006 take a look at your returns they are not correct 8) ret2 not2 Link to comment Share on other sites More sharing options...
spyrorocks Posted May 7, 2006 Author Share Posted May 7, 2006 I looked. Where are they incorrect? I could not see. Anyways, thats nice that some people can use this . I should now make a uninstall font function... [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
Valuater Posted May 7, 2006 Share Posted May 7, 2006 I looked. Where are they incorrect? I could not see. Anyways, thats nice that some people can use this . I should now make a uninstall font function...correction... i confused@error2 = Not A Font Fileand Return 2....also an install/uninstall with a gui would be a good idealist the fonts on the computer and maybe get others from web-sites... at users option8) Link to comment Share on other sites More sharing options...
RazerM Posted May 7, 2006 Share Posted May 7, 2006 yes you should My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 7, 2006 Developers Share Posted May 7, 2006 are you sure that a simple copy will work for fonts? I remember there have been posts before and that special dllcalls were needed to register the font. anyways this piece of code looks wrong to me: If Not $path[4] = "ttf" Then If Not $path[4] = "fon" Then SetError(2) Return 0 EndIf EndIf (Indenting code helps to make it readable) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
spyrorocks Posted May 7, 2006 Author Share Posted May 7, 2006 (edited) It works perfecly fine. No dllcalls are needed. I tested it and everything. It works fine.correction... i confused@error2 = Not A Font Fileand Return 2....also an install/uninstall with a gui would be a good idealist the fonts on the computer and maybe get others from web-sites... at users option8)Return 2 = Font already exists@error = 2 = The specifyed file to install as a font is not a font file.There is a differance.And yes, I should work on a gui browse thinggie.EDIT:PS- I am now working on a font libary! Edited May 7, 2006 by spyrorocks [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted May 14, 2006 Share Posted May 14, 2006 Make a font manager that you can just click on a font in a list press a uninstall button and it appears in another list, when you click it there you can press install and it's running again. I suggest moving the uninstalled fonts from "/fonts/" to "/fonts-/", i got this idea from Spybot Search and Destroy which does the same thing with startup programs. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now