PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/)
-   HTC Touch Pro (http://forum.ppcgeeks.com/htc-touch-pro/)
-   -   hopefully foolproof script to easily change titanium fonts (http://forum.ppcgeeks.com/htc-touch-pro/75023-hopefully-foolproof-script-easily-change-titanium-fonts.html)

raidzero 07-16-2009 08:27 PM

hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
UPDATE: check post 8 for the new mortscript which does not require the user to enter the name of the current font!

I kept thinking there had to be a better way to install titanium fonts than distributing entire CPR files. When someone installs a CPR you make they will only get support for what you had installed on your device at the time, not to mention destroy what other customizations they made. If there was only a way to search through the CPR file on the phone and replace the font names only, it would be foolproof. Enter mortscript. With this scripting language it is possible to change only the font names in the file. There will be no more "my opera panel does not have the right font now", etc. This is, in my tests at least, foolproof. I have uploaded a cab that will give you my LCD font from my other thread, but non destructive and anyone can do it. The install script will replace Tahoma and Segoe UI with the new font name, Digital-7. It will only work if tahoma is what your titanium is running, so to use this, uninstall other titanium font cabs.:headbang:

Mortscript is installed with this cab.
I have also included another little script I wrote called font_set. It is for the tinkerers who would like to change fonts on a whim and know what font they currently have (not that good at mortscript to figure out which font is in the CPR file and correctly parse it, yet) and what font they want to switch to, provided the new one is in \windows\fonts.

The install script also makes a backup of your CPRs. The uninstall script restores them. this should all be ROM-independent and should also work on any titanium-enabled device.

So here it is, please tell me how it works for you. :mrgreen:

It will put install and uninstall scripts in \program files\raidzero\lcd
the font utility script goes to \program files\raidzero and also a link is placed in the start menu programs.

ChaosTheory 07-17-2009 10:07 AM

Re: hopefully foolproof script to easily change titanium fonts
 
Thanks, I think this may be incorporated in my ROM as an easy way to add customization. Plus since I am starting out with a customized font, it will allow easy addition of extra panels, just run the script! I might tinker around with it some to ensure it does what I need it to, but original credit will still go to you!

+1 Great Work!

ChaosTheory 07-17-2009 04:10 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Something I noticed, you said it makes a backup file, and I see where it takes a .bak file and restores it to the a .cpr file, but I don't see where it makes the .bak file. in your install script i see the following lines:

Copy( "\windows\titanium_480x640.cpr", "\windows\titanium_480x640.cpr" )
Copy( "\windows\titanium_640x480.cpr", "\windows\titanium_640x480.cpr" )

Are those last files supposed to be .bak?

Looking good other than that!

raidzero 07-18-2009 08:45 AM

Re: hopefully foolproof script to easily change titanium fonts
 
yes they are. I guess I forgot to make the final cab and uploaded a premature version. whoops..

ChaosTheory 07-18-2009 09:16 AM

Re: hopefully foolproof script to easily change titanium fonts
 
Tested it out, works great! Created a modified cab that has 3 fonts and prebuilt scripts in it for my ROM, your font (script creator -Digital-7), mine (ROM creator - Chaos Times) and lwrdchvys (ROM guinea pig :lol: - MostWasted).

Haven't built it into the ROM yet, but did run the cab to test it. Also, I added a readme that gives you credit for the original script and links to your threads, as well as instructions and a recommendation that before changing fonts they run the backup script. Since the font scripts make a copy of the current cpr file, if they ran 2 fonts they would have the last font backed up, not the original, so if they reinstall the original between font changes, they will always have it available :)

raidzero 07-18-2009 09:29 AM

Re: hopefully foolproof script to easily change titanium fonts
 
Yes in that case I think it'd be easier just to run the switch script and input the current font and then tahoma as the desired.. the switching script is what I use all the time. it makes it so much easier to switch fonts on the fly without fear of ruining other settings, like titanium weather icon sizes, if someone is running different icons from the cpr instead of bronzeres.dll... I am trying to find out how to list directories in mortscript so it prompts the user with a list of all available fonts to choose from.

ChaosTheory 07-18-2009 05:17 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Yes, the switch script rules! Just trying to keep it simple for the noob who doesn't want to know how it works, just wants it to work :lol:

Not sure if it is possible, but if Mortscrip can restart just Titanium, rather than the whole phone, that would be quicker :)

EDIT: Think I might have found a way to just refresh Titanium, TWeather links to a program called CHomeRefresh.exe. That might do it :dontknow:

raidzero 07-19-2009 07:41 PM

Re: hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
that would be cool
i got it so that it can figure out what the current font is set as, attached updated mortscript. I'm using it for the switch script. use the part that defines sourcefont in the install script.

its a bit clunky in having to define lots of variables and do replace operations and stuff, but it works.

And yes, chomerefresh.exe works perfectly! sweet find.
+1

ChaosTheory 07-19-2009 07:55 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Awesome, +1 on the new script.

What it the command to run a file? Going to use your scripts in my ROM, but I want to replace the last lines with:

Message( Restarting Titanium - Enjoy!)
**Run Command** ( CHome.exe)

I'll look into it myself if your not sure, just thought you might know, and busy trying perfect my ROM.

raidzero 07-19-2009 08:01 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Quote:

Originally Posted by ChaosTheory (Post 1046047)
Awesome, +1 on the new script.

What it the command to run a file? Going to use your scripts in my ROM, but I want to replace the last lines with:

Message( Restarting Titanium - Enjoy!)
**Run Command** ( CHome.exe)

I'll look into it myself if your not sure, just thought you might now, and busy trying perfect my ROM.

Run("\windows\chomerefresh.exe")

of course the path needs to be correct..


All times are GMT -4. The time now is 01:36 PM.

Powered by vBulletin® ©2000 - 2020, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0