RE: Digest for titanium-desktop-transition@googlegroups.com - 1

40 views
Skip to first unread message

Boydlee Pollentine

unread,
May 24, 2012, 5:46:21 PM5/24/12
to titanium-desk...@googlegroups.com
Message in 1 Topic
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=0016367f94b4b30060474d22062

--0016367f94b4b30060474d22062
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

Have you tried using something such as cufon?

Sent from my Windows Phone
From: titanium-desk...@googlegroups.com
Sent: 24/05/2012 22:36
To: Digest Recipients
Subject: Digest for titanium-desk...@googlegroups.com - 1
Message in 1 Topic
=============================================================================
Today's Topic Summary
=============================================================================

Group: titanium-desk...@googlegroups.com
Url: http://groups.google.com/group/titanium-desktop-transition/topics

- Add files to installation or run a .vbs file to install extra
fonts [1 Update]
http://groups.google.com/group/titanium-desktop-transition/t/6d2e452bbae65024


=============================================================================
Topic: Add files to installation or run a .vbs file to install extra fonts
Url: http://groups.google.com/group/titanium-desktop-transition/t/6d2e452bbae65024
=============================================================================

---------- 1 of 1 ----------
From: PM <monte...@gmail.com>
Date: May 24 09:58AM -0700
Url: http://groups.google.com/group/titanium-desktop-transition/msg/6c189b84edc2783e

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





--0016367f94b4b30060474d22062
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html><head><meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Cont=
ent-Type"></head><body><div><div style=3D"font-family: Calibri,sans-serif; =
font-size: 11pt;">Have you tried using something such as cufon?<br><br>Sent=
from my Windows Phone<br></div></div><hr><span style=3D"font-family: Tahom=
a,sans-serif; font-size: 10pt; font-weight: bold;">From: </span><span style=
=3D"font-family: Tahoma,sans-serif; font-size: 10pt;">titanium-desktop-tran=
sit...@googlegroups.com</span><br><span style=3D"font-family: Tahoma,sans-s=
erif; font-size: 10pt; font-weight: bold;">Sent: </span><span style=3D"font=
-family: Tahoma,sans-serif; font-size: 10pt;">24/05/2012 22:36</span><br><s=
pan style=3D"font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: =
bold;">To: </span><span style=3D"font-family: Tahoma,sans-serif; font-size:=
10pt;">Digest Recipients</span><br><span style=3D"font-family: Tahoma,sans=
-serif; font-size: 10pt; font-weight: bold;">Subject: </span><span style=3D=
"font-family: Tahoma,sans-serif; font-size: 10pt;">Digest for titanium-desk=
top-tra...@googlegroups.com - 1 Message in 1 Topic</span><br><br></body=
></html><div style=3D"font-family: arial; font-weight: bold; color: #222222=
; padding: 0px">&nbsp;
<a name=3D"digest_top" style=3D"color: #222222">Today's Topic Summary</a>=
</div>
<p>Group: <a style=3Dcolor:15c;text-decoration:none href=3Dhttp://groups.go=
ogle.com/group/titanium-desktop-transition/topics>http://groups.google.com/=
group/titanium-desktop-transition/topics</a></p>
<ul style=3D"margin-left:3px; padding-left:0px">
<li type=3D"square" style=3D"color: #555555"><a style=3Dcolor:15c;text-deco=
ration:none href=3D"#group_thread_0">Add files to installation or run a .vb=
s file to install extra fonts</a> [1 Update]</li>

</ul>


=20
<a name=3D"group_thread_0"></a>
<div style=3D"background-color: #f5f5f5; font-family: arial; border-top: =
1px solid #e5e5e5; padding: 4px 0 5px 32px; "
>&nbsp;<a target=3D"_blank" href=3D"http://groups.google.com/group/tita=
nium-desktop-transition/t/6d2e452bbae65024" style=3D"color:15c;text-decorat=
ion:none"
>Add files to installation or run a .vbs file to install extra fonts<=
/a></div>

=20
<ul>
<span style=3D"color: ; font-weight: bold">PM &lt;monte.peter@gmail.c=
om&gt;</span> May 24 09:58AM -0700
&nbsp;<br /> <br />
Hi there,<br />
&nbsp;<br />
Since I can&#39;t use @fontface with titanium I was wondering if i could ad=
d a <br />
set of fonts to be installed with my app?<br />
One other aproach would be to ave a .vbs file in the app\Resources\fonts <b=
r />
folder that would install them like this:<br />
&nbsp;<br />
[code]<br />
&nbsp;<br />
Set ofso =3D CreateObject(&quot;Scripting.FileSystemObject&quot;)<br />
SourceFolder =3D ofso.GetParentFolderName(Wscript.ScriptFullName)<br />
&nbsp;<br />
Const FONTS =3D &amp;H14&amp;<br />
&nbsp;<br />
Set objShell =3D CreateObject(&quot;Shell.Application&quot;)<br />
Set oSource =3D objShell.Namespace(SourceFolder)<br />
Set oWinFonts =3D objShell.Namespace(FONTS)<br />
&nbsp;<br />
&#39; Lame VBscript needs 4 f*ing lines instead of &quot;if (/\.ttf$/i) &qu=
ot; ...<br />
Set rxTTF =3D New RegExp<br />
rxTTF.IgnoreCase =3D True<br />
rxTTF.Pattern =3D &quot;\.ttf$&quot;<br />
&nbsp;<br />
FOR EACH FontFile IN oSource.Items()<br />
IF rxTTF.Test(FontFile.Path) THEN <br />
oWinFonts.CopyHere FontFile.Path<br />
END IF<br />
NEXT<br />
&nbsp;<br />
[/code]<br />
&nbsp;<br />
&nbsp;<br />
Problem is that I can&#39;t seem to run process to call the file.<br />
&nbsp;<br />
Thanks<br />
Peter<br />

<p>&nbsp;</p>
</ul>
=20



<div style=3D"color:#555555; padding: 27px 0 0 40px">
<p>
You received this message because you are subscribed to the Google Grou=
p titanium-desktop-transition.<br />
You can <a style=3Dcolor:15c;text-decoration:none href=3D"mailto:titani=
um-desktop...@googlegroups.com">post via email</a>.<br />
To unsubscribe from this group, <a style=3Dcolor:15c;text-decoration:no=
ne href=3D"mailto:titanium-desktop-tr...@googlegroups.com"=
>send</a> an empty message.<br />
For more options, <a style=3Dcolor:15c;text-decoration:none href=3D"htt=
p://groups.google.com/group/titanium-desktop-transition/topics">visit</a> t=
his group.<br />
</p>


--0016367f94b4b30060474d22062--

PM

unread,
May 25, 2012, 7:10:56 AM5/25/12
to titanium-desk...@googlegroups.com
Hi  Boydlee,

I'm not quite interested in using cufón approach.
Don't want to always replace every single text line with images.
I was able to install the fonts with the vbs file but just can't make this process silence without no Windows dialog.

[TI code]

var echoCmd = ["C:\\Windows\\System32\\cmd.exe", '/C'];
     echoCmd.push ( "wscript");
     echoCmd.push ( Titanium.App.getHome() + "\\Resources\\fonts\\install.vbs");

var process = Titanium.Process.createProcess ( echoCmd );
     process.setOnReadLine ( function ( data )
     {
alert(data.toString());
     });
process.launch();

[/TI code]

[VBS 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$"

Const FOF_SILENT = &H4
Const FOF_RENAMEONCOLLISION = &H8
Const FOF_NOCONFIRMATION = &H10
Const FOF_ALLOWUNDO = &H40
Const FOF_FILESONLY = &H80
Const FOF_SIMPLEPROGRESS = &H100
Const FOF_NOCONFIRMMKDIR = &H200
Const FOF_NOERRORUI = &H400
Const FOF_NOCOPYSECURITYATTRIBS = &H800
Const FOF_NORECURSION = &H1000
Const FOF_NO_CONNECTED_ELEMENTS = &H2000

args = FOF_SILENT + FOF_NOCONFIRMATION + FOF_NOERRORUI

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

[/VBS code]


The VBS solution is quite handy since it does not require reboot. You just need to restart the app. Once again, problem is that it doesn't run in silent/background mode



Cheers
Peter










On Thursday, 24 May 2012 22:46:21 UTC+1, Boydlee wrote:
Message in 1 Topic
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=0016367f94b4b30060474d22062

--0016367f94b4b30060474d22062
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

Have you tried using something such as cufon?

Sent from my Windows Phone
Sent: 24/05/2012 22:36
To: Digest Recipients
Message in 1 Topic
=============================================================================
Today's Topic Summary
=============================================================================

top-transition@googlegroups.com - 1 Message in 1 Topic</span><br><br></body=
um-desktop-transition@googlegroups.com">post via email</a>.<br />
    To unsubscribe from this group, <a style=3Dcolor:15c;text-decoration:no=
Reply all
Reply to author
Forward
0 new messages