Add files to installation or run a .vbs file to install extra fonts

18 views
Skip to first unread message

PM

unread,
May 24, 2012, 12:58:33 PM5/24/12
to titanium-desk...@googlegroups.com
Hi there,

Since I can't use @fontface with titanium I was wondering if i could add a set of fonts to be installed with my app?
One other aproach would be to ave a .vbs file in the app\Resources\fonts folder that would install them like this:

[code]

Set ofso = CreateObject("Scripting.FileSystemObject")
SourceFolder = ofso.GetParentFolderName(Wscript.ScriptFullName)

Const FONTS = &H14&

Set objShell  = CreateObject("Shell.Application")
Set oSource   = objShell.Namespace(SourceFolder)
Set oWinFonts = objShell.Namespace(FONTS)

' Lame VBscript needs 4 f*ing lines instead of "if (/\.ttf$/i) " ...
Set rxTTF = New RegExp
rxTTF.IgnoreCase = True
rxTTF.Pattern = "\.ttf$"

FOR EACH FontFile IN oSource.Items()
    IF rxTTF.Test(FontFile.Path) THEN   
        oWinFonts.CopyHere FontFile.Path
    END IF
NEXT

[/code]


Problem is that I can't seem to run process to call the file.

Thanks
Peter
Reply all
Reply to author
Forward
0 new messages