webOS Nation Forums >  webOS apps and software >  webOS development > Custom fonts for any part of the Pre!
Custom fonts for any part of the Pre!

  Reply
 
LinkBack Thread Tools Display Modes
Old 10/05/2009, 09:21 AM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 50
Likes Received: 0
Thanks: 5
Thanked 10 Times in 2 Posts
Default Custom fonts for any part of the Pre!

This may have already been discussed, but I've found something that may prove useful to those who are really out to trick out their device.

There's a fork in the road ahead, but this will always be your jumping-off point:

1: Connect your device to your computer, and establish a USB drive connection.

Use a font you have on your computer already:
2: Start, Run, "C:\Windows\Fonts"
3: Copy the font file (usually a TTF) to your Pre via USB. Note that the name of the font file itself may differ from the actual font title.

Use a font from the Interwebs:
2: Visit dafont.com for some amazing free fonts.
3: Download one you would like to use, copy the font file to your Pre via USB.

4: Safely remove your device, now we have to copy the font into the folder Pre uses to find fonts it uses in WebOS.

The best way to do this is to download the Terminal service, and then the Terminal application, which you can do right from Preware.

5: Open Terminal (or Putty, whatever you're most comfortable with) and begin the process:

Code:
sudo -i
mount -o remount,rw /
cp /media/internal/(FONT).ttf /usr/share/fonts/(FONT).ttf
Ta-da! Obviously, where (FONT) is, this will be the actual name of the file. Make sure you capitalize wherever necessary in the filename, just to be safe. But how do we use this? Here's an example, using systemui.css, located in /usr/lib/luna/system/luna-systemui/stylesheets/ on your device.

Code:
.status-bar {
		color: #fff;
		font-family: GeosansLight;
		font-size: 14px;
		line-height: 25px;
}
So in this example, I've changed the font in only the status bar, to GeosansLight, a font I have installed on my Pre. When you use the line font-family, you have to use the title of the font, not the filename. The Pre will find it by looking in its default font folder, so you're good to go. Remember to remount back to read-only, reboot, and zing!--a new font in your status bar!

This effect can be applied anywhere in the device, and there is no risk of damaging the default fonts, because if it can't find the font you're looking for, it'll default to the usual Pre font.

More tutorials coming soon, including funky text effects you can use in conjunction with this tweak.

Enjoy!

Last edited by superkyol; 10/05/2009 at 09:28 AM.
superkyol is offline   Reply With Quote
Old 10/05/2009, 10:37 AM   #2 (permalink)
Member

 
spdsktr's Avatar
 
Join Date: Aug 2009
Location: Pensacola, FL
Posts: 866
Likes Received: 33
Thanks: 127
Thanked 478 Times in 156 Posts
Default

You should do an app for this. A person has posted a Klingon Language set fof FlashCards and even has it's own font. Even a Klingon theme. But I could see many people using this to customize their Pre and use whatever font they want. Other apps could then use it to setup font's for their app as well.
spdsktr is offline   Reply With Quote
Old 10/05/2009, 10:39 AM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 50
Likes Received: 0
Thanks: 5
Thanked 10 Times in 2 Posts
Default

Quote:
Originally Posted by spdsktr View Post
You should do an app for this. A person has posted a Klingon Language set fof FlashCards and even has it's own font. Even a Klingon theme. But I could see many people using this to customize their Pre and use whatever font they want. Other apps could then use it to setup font's for their app as well.
Good idea! I don't have a lot of spare time, so someone will more than likely beat me to the punch, but I'll see what I can do!
superkyol is offline   Reply With Quote
Old 10/05/2009, 10:56 AM   #4 (permalink)
Member
 
Blazinfly's Avatar
 
Join Date: Aug 2009
Posts: 16
Likes Received: 0
Thanks: 16
Thanked 1 Time in 1 Post
Default

It would be nice if there was a tweak/app that allowed you to change the font size of email and text messages for some of us who are no longer able to see as well as in our youth without the aid of reading glasses which makes reading messages while driving (I know you should not do this, but my time is very precious) a little difficult. Just a little feature in the preferences section of those apps would be sufficient.

I am about as able to make this happen as a monkey is able to knit a sweater so it will have to be someone who understands all of the techinical mumbo jumbo.
Blazinfly is offline   Reply With Quote
Old 10/05/2009, 11:00 AM   #5 (permalink)
Member
 
Join Date: Jun 2009
Posts: 50
Likes Received: 0
Thanks: 5
Thanked 10 Times in 2 Posts
Default

Quote:
Originally Posted by Blazinfly View Post
I would be nice if there was a tweak app that allowed you to change the font size of email and text messages...
I'm not sure about the app part, but I can definitely write a patch to do this. I can either get a general consensus of what a good size would be (15% larger, 25% larger?), or just go ahead and make something up. Also, the fact that different fonts can be applied specifically to the Messaging and Email apps, means that bolder typefaces can be used as well.

When I get home from work, I'll see what I can do about this, and hopefully have a patch out within a couple of days.
superkyol is offline   Reply With Quote
Old 10/05/2009, 11:14 AM   #6 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

You should also try 1001fonts

They have a LOT of different custom made fonts.

Great find btw! I will be trying this soon...

Hopefully.
__________________
SirataXero is offline   Reply With Quote
Old 10/05/2009, 11:35 AM   #7 (permalink)
Member
 
Blazinfly's Avatar
 
Join Date: Aug 2009
Posts: 16
Likes Received: 0
Thanks: 16
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by superkyol View Post
I'm not sure about the app part, but I can definitely write a patch to do this. I can either get a general consensus of what a good size would be (15% larger, 25% larger?), or just go ahead and make something up. Also, the fact that different fonts can be applied specifically to the Messaging and Email apps, means that bolder typefaces can be used as well.

When I get home from work, I'll see what I can do about this, and hopefully have a patch out within a couple of days.
That would be excellent if you could do this - I would say that 25 percent would be a great advantage for all. Most appreciative.
Blazinfly is offline   Reply With Quote
Old 10/06/2009, 12:38 AM   #8 (permalink)
Member
 
Join Date: Sep 2009
Posts: 8
Likes Received: 0
Thanks: 1
Thanked 6 Times in 3 Posts
Default Can your patch include my change for email font size?

I found a way to change the font size for sent emails. Maybe you could include this in your patch to modify Pre font sizes?

Here are the mods I did on the emulator (I'm going to try them on my Pre next)...

1) /usr/palm/applications/com.palm.app.email/app/models/Email.js
Find the line near the bottom that defines Email.kSignaturePlaceholder, and change it to this:
Email.kSignaturePlaceholder = “<span style=’font-family:Prelude, Arial, san-serif; font-size:18px’><br><br></span><span id=’signature’></span>”

This first change adds font-size:18px to match the default Prelude font size you get when composing email on the Pre. The original code had Verdana where I have Arial. You can change "Arial" to another font name to send the email in a different font if desired.

2) /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
Find the line in the send function that says...
var theMessageBody = this.controller.get('msg_rte').innerHTML;
and add this line after it...
theMessageBody = theMessageBody.replace(/font-size:18px/,"font-size:15px");

The second change does a replace on the string that gets sent as the message body, and changes the 18px size to 15px size. 15px seems to be 11.5 font size, which for me is just enough of a change to make my Pre emails look acceptable in Outlook.

Maybe your patch could let the user pick the font type and size to send emails with, and adjust the above mods accordingly.

Last edited by menomonee; 10/06/2009 at 12:48 AM.
menomonee is offline   Reply With Quote
Thanked by Jonolee, mcotten, superkyol
Old 10/06/2009, 06:10 PM   #9 (permalink)
Member
 
Join Date: Feb 2009
Location: michigan
Posts: 1,609
Likes Received: 3
Thanks: 20
Thanked 204 Times in 149 Posts
Default

I've been working on a similar goal: http://forums.precentral.net/web-os-...ome-parts.html

I too am looking at the possibility of a program such as FontSubst for palmOS. The idea is to make it possible for users to choose global fonts and sizes to override fonts globally and to allow specifying by app or go as far as for only certain elements. As you can see in my thread I have located the segments containing code for some global and app specific fonts/sizes. Patches can be used to make the alterations however an app would be required to allow the fullest customization for a grander user base.

What I'm thinking needs to happen is create the app to get input from the users as to what fonts and sizes they want to use and for what global and app specific elements they want to change. Then the app generates the patch to apply. Then applies the patch. Warn the user that luna needs to be restarted so they can tidy up any open apps they are working with just in case (we don't want to cause any trouble with open apps however remote the possibility). And include a button to proceed or cancel. I imagine it would apply the patches like preware does.

The thing is there are so many different font and size specifications from global to app specific that it may be near impossible to make it possible to alter everything and is far to grand of a project for one or even a few to work on. However I would love to see a program like this for webOS. However it would be in the best interest of the community for such an app to be free and open source. I can offer my services to help with a project to make the app happen but I can't dedicate a lot of time to it.
StoneRyno is offline   Reply With Quote
Old 10/06/2009, 06:11 PM   #10 (permalink)
Member
 
Join Date: Jul 2009
Posts: 73
Likes Received: 0
Thanks: 50
Thanked 51 Times in 20 Posts
Default

Quote:
Originally Posted by menomonee View Post
I found a way to change the font size for sent emails. Maybe you could include this in your patch to modify Pre font sizes?

Here are the mods I did on the emulator (I'm going to try them on my Pre next)...

1) /usr/palm/applications/com.palm.app.email/app/models/Email.js
Find the line near the bottom that defines Email.kSignaturePlaceholder, and change it to this:
Email.kSignaturePlaceholder = “<span style=’font-family:Prelude, Arial, san-serif; font-size:18px’><br><br></span><span id=’signature’></span>”

This first change adds font-size:18px to match the default Prelude font size you get when composing email on the Pre. The original code had Verdana where I have Arial. You can change "Arial" to another font name to send the email in a different font if desired.

2) /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
Find the line in the send function that says...
var theMessageBody = this.controller.get('msg_rte').innerHTML;
and add this line after it...
theMessageBody = theMessageBody.replace(/font-size:18px/,"font-size:15px");

The second change does a replace on the string that gets sent as the message body, and changes the 18px size to 15px size. 15px seems to be 11.5 font size, which for me is just enough of a change to make my Pre emails look acceptable in Outlook.

Maybe your patch could let the user pick the font type and size to send emails with, and adjust the above mods accordingly.
memomonee, thanks a ton for looking into this. I'm sure there are plenty of other Outlook users out there that cringe at the font size used in emails sent from the Pre -- very unprofessional looking.

Here's hoping this can be made into an easy-to-apply patch.

Thanks!
Jonolee is offline   Reply With Quote
Old 10/06/2009, 07:10 PM   #11 (permalink)
Member
 
Join Date: Aug 2009
Posts: 12
Likes Received: 0
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Great find!
foecus is offline   Reply With Quote
Old 10/16/2009, 12:58 AM   #12 (permalink)
Member
 
Join Date: Feb 2005
Posts: 197
Likes Received: 0
Thanks: 3
Thanked 1 Time in 1 Post
Default

Having trouble getting this to work. Any news on this becoming a patch?
beavis10 is offline   Reply With Quote
Old 10/19/2009, 09:38 PM   #13 (permalink)
Member
 
Join Date: May 2005
Posts: 113
Likes Received: 0
Thanks: 25
Thanked 11 Times in 6 Posts
Default

Quote:
Originally Posted by beavis10 View Post
Having trouble getting this to work. Any news on this becoming a patch?
I couldn't get the font size tweak to work either and the default font size is very unprofessional looking. I too am anxiously awaiting a patch.
smartphoney is offline   Reply With Quote
Old 10/20/2009, 01:58 PM   #14 (permalink)
Member
 
Join Date: Jul 2009
Posts: 73
Likes Received: 0
Thanks: 50
Thanked 51 Times in 20 Posts
Default

I've posted a patch that you can apply via WebOSQuickInstall here. Instructions for installing the patch are detailed in the thread.

Hope this helps. Thanks to menomenee and brianmb99 for their proposed fixes (which I cannibalized when making the patch).

Last edited by Jonolee; 10/20/2009 at 02:24 PM.
Jonolee is offline   Reply With Quote
Thanked By: smartphoney
Old 10/21/2009, 12:06 AM   #15 (permalink)
Member
 
dragbug's Avatar
 
Join Date: Sep 2009
Location: Utah
Posts: 347
Likes Received: 0
Thanks: 57
Thanked 48 Times in 34 Posts
Default

This in an application would be perfect! I sure hope someone pics this up and runs with it. Patches are nice but an app to change fonts any time and for any place would be perfect.
dragbug is offline   Reply With Quote
Old 10/21/2009, 05:02 PM   #16 (permalink)
Member
 
Join Date: Feb 2009
Location: michigan
Posts: 1,609
Likes Received: 3
Thanks: 20
Thanked 204 Times in 149 Posts
Default

Quote:
Originally Posted by dragbug View Post
This in an application would be perfect! I sure hope someone pics this up and runs with it. Patches are nice but an app to change fonts any time and for any place would be perfect.
Did you ever use a palmOS device? If so and you stil have it load up FontSubst. I've been wanting something like that for webOS. But it may be harder to do that it seems. I'm guessing that the app will have to read in the CSS etc for each thing being changed and then code a replacement file(s) to override the define font and size.
StoneRyno is offline   Reply With Quote
Old 11/04/2009, 12:35 PM   #17 (permalink)
Member
 
Join Date: Nov 2009
Posts: 5
Likes Received: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by menomonee View Post
I found a way to change the font size for sent emails. Maybe you could include this in your patch to modify Pre font sizes?

Here are the mods I did on the emulator (I'm going to try them on my Pre next)...

1) /usr/palm/applications/com.palm.app.email/app/models/Email.js
Find the line near the bottom that defines Email.kSignaturePlaceholder, and change it to this:
Email.kSignaturePlaceholder = “<span style=’font-family:Prelude, Arial, san-serif; font-size:18px’><br><br></span><span id=’signature’></span>”

This first change adds font-size:18px to match the default Prelude font size you get when composing email on the Pre. The original code had Verdana where I have Arial. You can change "Arial" to another font name to send the email in a different font if desired.

2) /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
Find the line in the send function that says...
var theMessageBody = this.controller.get('msg_rte').innerHTML;
and add this line after it...
theMessageBody = theMessageBody.replace(/font-size:18px/,"font-size:15px");

The second change does a replace on the string that gets sent as the message body, and changes the 18px size to 15px size. 15px seems to be 11.5 font size, which for me is just enough of a change to make my Pre emails look acceptable in Outlook.

Maybe your patch could let the user pick the font type and size to send emails with, and adjust the above mods accordingly.
I'm new to all this. Could you possibly write up some step-by-step instructions for those of us who have never changed code, don't know what emulator is, etc...? Many thanks.
benjaminsachs is offline   Reply With Quote
Old 11/13/2009, 12:55 PM   #18 (permalink)
Member
 
Join Date: Jan 2007
Posts: 445
Likes Received: 10
Thanks: 74
Thanked 85 Times in 40 Posts
Default

where could i find and change the fonts of Memos, Messaging and Web Browser plz?

is the solution to change fonts on palm pre with unicode fonts will let me read forgin langauges like Hebraw and Arabic?

i have the Arial Unicode MS font, and i already upload it to my Palm Pre Fonts Folder. how can i point the Memos, Messaging and Web Browser to use that font? which .css file should i edit plz?
amjz is offline   Reply With Quote
Old 11/13/2009, 10:45 PM   #19 (permalink)
Member
 
Join Date: Feb 2009
Location: michigan
Posts: 1,609
Likes Received: 3
Thanks: 20
Thanked 204 Times in 149 Posts
Default

Quote:
Originally Posted by amjz View Post
where could i find and change the fonts of Memos, Messaging and Web Browser plz?

is the solution to change fonts on palm pre with unicode fonts will let me read forgin langauges like Hebraw and Arabic?

i have the Arial Unicode MS font, and i already upload it to my Palm Pre Fonts Folder. how can i point the Memos, Messaging and Web Browser to use that font? which .css file should i edit plz?
I changed the font sizes for memo and messaging. A memo is a big text entry box so changing it will change all text entry boxes of the same type. The text entry for text and IM messages is of that type. It is specified by the framework (global-textfields.css). I believe it was the textarea.text-edit { code segment. For messaging if you want to change the message bubble text that is in the apps css and I think is the .my-chat .chat-balloon-wrapper, .their-chat .chat-balloon-wrapper { code segment. I've neve looked at the web browser so someone else will have to take that one.
StoneRyno is offline   Reply With Quote
Old 01/24/2010, 02:10 PM   #20 (permalink)
Member
 
roneyii's Avatar
 
Join Date: Aug 2009
Location: Indianapolis
Posts: 128
Likes Received: 0
Thanks: 60
Thanked 6 Times in 5 Posts
Default

Quote:
Originally Posted by spdsktr View Post
You should do an app for this. A person has posted a Klingon Language set fof FlashCards and even has it's own font. Even a Klingon theme. But I could see many people using this to customize their Pre and use whatever font they want. Other apps could then use it to setup font's for their app as well.
Indeed. And as of this past Wednesday, I can now type in Klingon on my Prē.
problem is, the device has limits on what it's willing to accept.
I can get the top bar to display the altered fonts, but not the app names.
roneyii is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0