Sign in to follow this  
Followers 0
icadea

Fonts portable

1 post in this topic

Could not find this in the forum after search...

Am posting what was found on the link below

http://portableapps.com/node/12912

The download link

http://www.mediafire.com/?0itmcsywj5l

The source

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=fonts-portable.ico
#AutoIt3Wrapper_outfile=..\..\FontsPortable.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseAnsi=y
#AutoIt3Wrapper_Res_Description=Fonts Portable
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Process.au3>
#include <Misc.au3>

Opt("TrayMenuMode", 1);
Opt("TrayOnEventMode", 1);
TraySetToolTip("Fonts Portable");

_Singleton("FontsPortable");

Local $files = FileFindFirstFile(@ScriptDir & "\Data\fonts\*.ttf");
If $files == -1 Then
    MsgBox(48, "No Fonts", "No fonts were found in the directory " & @ScriptDir & "\Data\fonts\.");
Else
    While True
        Local $file = FileFindNextFile($files);
        If @error Then ExitLoop;
        ShellExecute($file, "", @ScriptDir & "\Data\fonts\", "open", @SW_HIDE);
    WEnd
EndIf


Dim $openFontsDirItem = TrayCreateItem("&Open Fonts Directory");
Dim $reloadFontsDirItem = TrayCreateItem("&Reload Fonts");
TrayCreateItem("");
Dim $exitItem = TrayCreateItem("&Exit");

TrayItemSetOnEvent($openFontsDirItem, "openFontsDirItem_Click");
TrayItemSetOnEvent($reloadFontsDirItem, "reloadFontsDirItem_Click");
TrayItemSetOnEvent($exitItem, "exitItem_Click");

While True
    Sleep(200);
WEnd

Func openFontsDirItem_Click()
    If FileExists(@ScriptDir & "\..\XenonPortable\XenonPortable.exe") Then
        ShellExecute(@ScriptDir & "\..\XenonPortable\XenonPortable.exe", @ScriptDir & "\Data\fonts");
    Else
        ShellExecute(@ScriptDir & "\Data\fonts");
    EndIf
EndFunc

Func reloadFontsDirItem_Click()
    Dim $windows = WinList();
    Dim $i;
    For $i = 1 To $windows[0][0]
        Dim $process = WinGetProcess($windows[$i][1]);
        If _ProcessGetName($process) = "fontview.exe" And BitAND(WinGetState($windows[$i][1]), 2) <> 2 Then ;; This is a font viewer and is not visible.
            WinClose($windows[$i][1]);
        EndIf
    Next
    
    Local $files = FileFindFirstFile(@ScriptDir & "\Data\fonts\*.ttf");
    If $files == -1 Then
        MsgBox(48, "No Fonts", "No fonts were found in the directory " & @ScriptDir & "\Data\fonts\.");
    Else
        While True
            Local $file = FileFindNextFile($files);
            If @error Then ExitLoop;
            ShellExecute($file, "", @ScriptDir & "\Data\fonts\", "open", @SW_HIDE);
        WEnd
    EndIf
EndFunc

Func exitItem_Click()
    SplashTextOn("Fonts Portable", "Please wait while Fonts Portable closes.", 200, 50);
    Dim $windows = WinList();
    Dim $i;
    For $i = 1 To $windows[0][0]
        Dim $process = WinGetProcess($windows[$i][1]);
        If _ProcessGetName($process) = "fontview.exe" And BitAND(WinGetState($windows[$i][1]), 2) <> 2 Then ;; This is a font viewer and is not visible.
            WinClose($windows[$i][1]);
        EndIf
    Next
    SplashOff();
    
    Exit(0);
EndFunc

Share this post


Link to post
Share on other sites



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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0