PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   HTC Touch Pro (http://forum.ppcgeeks.com/forumdisplay.php?f=63)
-   -   hopefully foolproof script to easily change titanium fonts (http://forum.ppcgeeks.com/showthread.php?t=75023)

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..

ChaosTheory 07-19-2009 08:17 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Thanks! Thought that might be what it was, but don't like guessing at scripts :lol: I'd end up frying something:???:

raidzero 07-20-2009 04:28 PM

Re: hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
Quote:

Originally Posted by ChaosTheory (Post 1046078)
Thanks! Thought that might be what it was, but don't like guessing at scripts :lol: I'd end up frying something:???:


heh, mortscript is pretty easy to use and harmless as long as you don't do anything obviously dangerous; though while learning to do the string operations I have ended up with many broken CPR's lol. As far as getting a list of installed fonts WITH INTERNAL NAMES (I can return a list of properly formatted filenames) it seems to be impossible ... need to use the freetype library it looks like and that is beyond me at this point, I will install visual studio anyway though and poke around.

here is my script that displays the ttf files without extensions in a message box:

ChaosTheory 07-20-2009 04:56 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Update, made a cab and then created an OEM out of the scripts you created and incorporated it into my ROM. Works like a charm! I can post the cab if you would like. (It assumes you already have mortscript and Program Files>CHome Editor>CHomeRefresh.exe)

raidzero 07-20-2009 07:40 PM

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

Originally Posted by ChaosTheory (Post 1047632)
Update, made a cab and then created an OEM out of the scripts you created and incorporated it into my ROM. Works like a charm! I can post the cab if you would like. (It assumes you already have mortscript and Program Files>CHome Editor>CHomeRefresh.exe)


I think you should incorporate mortscript and chomerefresh in the cab. having people install dependencies is one thing on linux/windows pc but IMO quite another on a phone ...

post it I wanna see

raidzero 07-20-2009 07:42 PM

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

Originally Posted by raidzero (Post 1047994)
I think you should incorporate mortscript and chomerefresh in the cab. having people install dependencies is one thing on linux/windows pc but IMO quite another on a phone ...

post it I wanna see

for that matter post the rom.. lol

I am interested in making one with the focus being speed and stability, for business users, but don't know where to start. I can make my own oems and make cabs from oems but I just don't know how to use SYS files with my OEMs...

ChaosTheory 07-20-2009 09:01 PM

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

Originally Posted by raidzero (Post 1047999)
for that matter post the rom.. lol

I am interested in making one with the focus being speed and stability, for business users, but don't know where to start. I can make my own oems and make cabs from oems but I just don't know how to use SYS files with my OEMs...

Working out the kinks, but should be user ready soon. Lwrdchvy was beta testing it for me, but he had to leave :???: Trying to make it quick with common tools, and once I post it I am planning on relying heavily on user input to make it better :)

Still learning the sys files, but if I can do it I'm sure you could :lol: Just a matter of browsing through and finding out what everything does.

The cab doesn't have the files cuz the ROM has them already :) I will modify the cab and get it posted with the dependent files first thing tomorrow, gotta go now though.

ChaosTheory 07-21-2009 08:37 AM

Re: hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
Here is the modified cab. In includes your original LCD font, Chaos Times font, and lwrdchvy's MostWasted font. It also includes Mortscript and CHomeRefresh, so installing this cab should make you all set to change fonts :)

EDIT: Updated cab file to correct font file not reading right.

raidzero 07-21-2009 03:35 PM

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

Originally Posted by ChaosTheory (Post 1048915)
Here is the modified cab. In includes your original LCD font, Chaos Times font, and lwrdchvy's MostWasted font. It also includes Mortscript and CHomeRefresh, so installing this cab should make you all set to change fonts :)


I was curious and downloaded the cab but none of the ttf's open. I wanted to see what chaos times was...

ChaosTheory 07-21-2009 03:54 PM

Re: hopefully foolproof script to easily change titanium fonts
 
That'w weird. Updated the cab, should work now. Not sure why it didn't before, but for some reason it wasn't recognizing them at font files :dontknow:

raidzero 07-21-2009 04:25 PM

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

Originally Posted by ChaosTheory (Post 1049990)
That'w weird. Updated the cab, should work now. Not sure why it didn't before, but for some reason it wasn't recognizing them at font files :dontknow:


on the first one it only got the first 700 bytes of each ttf. anyway the new cab they work on.

ChaosTheory 07-21-2009 04:57 PM

Re: hopefully foolproof script to easily change titanium fonts
 
Weird. As long as it works now I guess.

schollianmj 07-23-2009 04:32 PM

Re: hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
Hmmm.... Im using the CAb that Chaos posted and it is not doing anything. with the exception of the two readme files regardless what icons I tap i get a message that it is not a valid application. i have mortscript 4.2 installed seperately, but even with it ot installed these arent doing anything.

On a side note, I used active sync to copy the two CPR files from my device to the desktop, and opened them in notepad. changed every mention of Tahoma to the font that I wanted and made sure the font was in my windows/font folder. replaced the CPR files and restarted the system. no changes. this really cant be that freaking hard to do. if I post a zip of my CPR files and the font that I am trying to change it to could one of you guys change it for me so I can see what I am NOT doing inside them? I know its asking a lot, but I am really trying to learn here... :)

raidzero 07-23-2009 04:39 PM

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

Originally Posted by schollianmj (Post 1055464)
Hmmm.... Im using the CAb that Chaos posted and it is not doing anything. with the exception of the two readme files regardless what icons I tap i get a message that it is not a valid application. i have mortscript 4.2 installed seperately, but even with it ot installed these arent doing anything.

On a side note, I used active sync to copy the two CPR files from my device to the desktop, and opened them in notepad. changed every mention of Tahoma to the font that I wanted and made sure the font was in my windows/font folder. replaced the CPR files and restarted the system. no changes. this really cant be that freaking hard to do. if I post a zip of my CPR files and the font that I am trying to change it to could one of you guys change it for me so I can see what I am NOT doing inside them? I know its asking a lot, but I am really trying to learn here... :)


Make sure youre using the internal font name not the file name in the CPR. open up your font (ttf) in windows font viewer on your PC. btw OTF fonts do not work and must be converted to TTF

ChaosTheory 07-23-2009 04:53 PM

Re: hopefully foolproof script to easily change titanium fonts
 
1 Attachment(s)
Here, give this a try.

Think the problem might have been that they were marked as read only files. :dontknow:

schollianmj 07-23-2009 04:57 PM

Re: hopefully foolproof script to easily change titanium fonts
 
mine is TTF. lt me see if I can figure out what the other thing is you are trying to say... :) ok, try this. I installed Chaos's cab. now in windows\fonts I have Chaos Times.ttf I copied this to my PC and opened it. the name inside is "Chaos Times". so then in my CPR file I should be able to simply for the CLOCK tab anywhere it says tahoma replace that with Chaos Times and my font shold change on the CLOCK tab... Right? I changed it for every entry of Tahoma under Clock, both condensed and the other one... quite a few different spots. I even went so far as to copy that Chaos Times.ttf to \Windows\ but still no dice.

I know its something stupid, and I appreciate you taking the time to help me out a bit.

schollianmj 07-23-2009 05:02 PM

Re: hopefully foolproof script to easily change titanium fonts
 
when the CPR goes back onto the device should it be marked Read only? when I forst copied them OFF the device they were. after I made my initial changes I had to uncheck read only so I could save them. but before I put them back on the device I made them read only. I also tried once with Chaos's origional cab making them not read only first. but no dice.

Chaos, thank you, that last cab you posted here worked great. Now I am gong to try to rip it apart to see what you did, that I haddent... :)

schollianmj 07-23-2009 05:06 PM

Re: hopefully foolproof script to easily change titanium fonts
 
ok Chaos... One more request, man I feel like I am being a pain in your ***.... could you post the CPR files that you made? I am trying to find out what you did that I diddnt. I used WinRar on the CAB you made me, and I got a Setup.xml and then a number of files that end in 001, 002 003, yadda yadda yadda... I normally would just use HJSplit to re compile those... but I doubt they are movie files... :) Thank you so much for the cab though. it did exactly what I wanted. :)

ChaosTheory 07-23-2009 05:08 PM

Re: hopefully foolproof script to easily change titanium fonts
 
need to get WinCE Cab :) All I did was open remove the write protection from them and change the Tahoma to Requiem.


All times are GMT -4. The time now is 11:53 PM.

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


Content Relevant URLs by vBSEO 3.6.0