[Tutorial] Port Fonts to iPhone
by gaurav on Aug.30, 2008, under iPhone
i finally took the time to write the much awaited tutorial describing the process of porting fonts for iPhone.. this is important as iPhone users have many requests for fonts of their choice and as much as i’d like to, i simply don’t have the time to fulfill all these demands..
to cut a long story short..
“Give a man a fish, he’ll eat for a day, teach a man to fish and he’ll eat for a lifetime.”
haha..
Terms for this tutorial:
default font is the unmodified font that is present on your iPhone
custom font is the font that you are going to port for your iPhone
ported font is the result of the process that will be placed on your iPhone
Let’s see what all we need to begin with the process.. Check list:
- 1. The font you want to port.
- 2. The font you want to replace on the iPhone.
- 3. FontLab Studio
- 4. The desire to change things..
If you’re porting the Myriad font to the System [Helvetica] font, make sure you have the files [TTF or PFB/PFM or other] for both the Myriad Regular font and the Myriad Bold font.. if you don’t have the bold font file, you can convert the Regular font to the Bold font with FontLab Studio [using the Transformations panel] but the conversion might not be perfect.
You will need the default font for some important information like metadata and some glyphs that the custom font may not have. Make a new folder on your desktop “Custom Fonts” for your custom font work and keep the original default fonts in that folder. Keep the custom fonts in folders with their names under this folder, you can export the ported font to the corresponding folder as well.. [this is the convention i follow, you are free to think of something better]
You can copy the default fonts from this folder on your iPhone /System/Library/Fonts/Cache/
http://www.fontlab.com/font-editor/fontlab-studio/
You need the full registered version of FontLab Studio. The demo version will generate only 20 glyphs in a font. FontLab Studio costs $649, although there are a few alternative means of obtaining the software which i will not discuss here [Google is your friend, so are Demonoid and ThePirateBay]..
[you might want to keep FontCreator as a backup software. i tried to open Calibri font with FontLab Studio and it crashed everytime i tried.. FontCreator is not as feature rich but you can export the font and then use it in FontLab Studio.]
First let’s take a look at the metadata of default fonts that may be replaced, these are the ones that are usually replaced, though all of them can be easily replaced..
Helvetica.ttf

HelveticaBold.ttf

LockClock.ttf

MarkerFeltThin.ttf

The screenshots show the metadata that is embedded in the fonts. If you replace a default font with a custom font with incorrect metadata, the iPhone OS will load the font but it will not find the data it is looking for and the application will most likely crash. Incorrect metadata in MarkerFeltThin.ttf will cause MobileNotes to crash, incorrect data in LockClock.ttf will cause SWOD, incorrect metadata in Helvetica.ttf or HelveticaBold.ttf will cause SpringBoard to crash.
So if you make any custom font to replace the default fonts, you must take care to maintain the correct metadata. It is therefore a good idea to start with the default font and to copy glyphs from the custom font over glyphs of the default font, this way you also maintain any extra glyphs the default font has that the custom font doesn’t, so it makes the font more complete.
NOTE: If you’re porting a system font, it is *absolutely essential* that you copy the glyphs from custom font over the default font. Helvetica and HelvetivaBold have around 2135 glyphs, a huge majority of which will not be present in the custom font you’re going to port. Missing glyphs in system font will totally ruin the purpose of porting it.
Important things to do before the actual port:
- 1. Change Metrics and Dimensions of the default fonts.
- 2. Make sure you have a proper folder structure to handle the default fonts and custom fonts. This is important because very soon you’ll have dozens of fonts with the same name.
iPhone default fonts have a UPM size of 2048, which makes working with Metrics & Dimensions a bit of a hassle, setting this value to 1000 makes life simpler. We will also edit some other Metrics & Dimensions here. Set values as shown in the screenshots.
alternatively you can download the default fonts i’ve attached here and use them as templates. they have all the required settings and glyphs. setting vary for the system fonts, notes font and lock clock font. so it’s better to use the templates..
Download: Font Templates for Port (1631)
Steps:
a. Open the default font with FontLab Studio.
b. File > Font Info
c. Metrics & Dimensions

Make sure the checkbox for “Scale all glyphs according to UPM size change” is checked.
d. Metrics & Dimensions > Key Dimensions

e. Metrics & Dimensions > TrueType-specific metrics

f. Metrics & Dimensions > Subscript and Superscript

g. For Helvetica.ttf and HelveticaBold.ttf make sure the glyph uni25CF [black circle] is present in the font. otherwise the password field will show up empty on the iPhone. you can get this glyph from fonts on your system. see here: http://www.fileformat.info/info/unicode/char/25cf/fontsupport.htm
h. File > Generate Font
i. Overwrite the default font that you opened for editing. Otherwise use a label in your filenames for default fonts that you’ve modified, so that they’re easy to recognize. We will work only with these modified fonts.
Download: Font Templates for Port (1631)
The port process:
- 1. Open both the default font and the custom font in FontLab Studio.
- 2. Change the UPM size of custom font to 1000.
- 3. Select all glyphs of custom font.
- 4. Copy selected glyphs.
- 5. Select the default font window and paste glyphs.
- 6. Select layers for Paste Special.
- a. Outline
- b. Left sidebearing
- c. Right sidebearing
- d. Adv. width
- e. Left Kerning
- f. Right Kerning
- g. Ignore destination selection, map glyphs by name
- 7. Generate the font.
- 8. Save the ported font.
- Done.
Arrange font windows by Window > Tile Horizontally.

Glyphs can only be copied between fonts having the same UPM size.
Open Font Info window File > Font Info.


Notice that i have deselected the .notdef glyph of custom font as it is blank. We will not copy this blank glyph so that we retain the glyph in the default font.
Click once in the default font window and paste the copied glyphs using Edit > Paste Special.

This is the main step that you need to take care of, these setting have to exactly as shown in the screenshot or you’ll mess up the default font and have to start over again.
These checkboxes must be checked:
All other checkboxes must be unchecked.

if it’s the system font you’re porting and you’re not using the template i’ve attached here, make sure you copy the glyph uni25CF to the font [using the same paste special settings as above] before going any further.
We’ve finished copying the glyphs. Check once for any errors or glitches in the font that you may easily notice by just scanning the glyphs once..
Once certain that the glyphs are okay we can generate the font by File > Generate Font

Simply copy the ported font to the fonts folder [/System/Library/Fonts/Cache/] on your iPhone and reboot once for it to take effect.. make sure you keep backup of original fonts in case something goes wrong..
Download: Font Templates for Port (1631)


















August 31st, 2008 on 3:36 am
This is an excellent tut, very well put 2gether. Its rather simple but intricate at the same time. I, like you would love to port a font over but this just seems to take a lot of time. At least now I know where to come when Im ready. Then again, if anyone wants to make a quick $ I can be lazy and spend time with the kids and u can do it 4 me
August 31st, 2008 on 9:20 am
This is a great tutorial, and thank you.
You might want to mention that FontLab Studio is $640????
August 31st, 2008 on 12:04 pm
@CompC: yes i realize that. i did not want to get into a discussion of the rights and wrongs of using pirated software.. it’s upto the user to decide how to obtain the software.
i have updated the post with info that the demo version generates only 20 glyphs. thanks for that info..
August 31st, 2008 on 3:28 pm
Hi, very good tutorial.
But the app is to expensive for me.
Can you port 1 font for me plz ?
you can find it here http://www.khoa.fr/Fonts/Bradley_Hand_ITC.ttf
Thanks you.
September 3rd, 2008 on 5:38 pm
thanks man, u the man!!
salute! kewL tutorial
September 7th, 2008 on 11:42 pm
Can you write up something for firmware 1.1.4? Somehow this doesn’t work on 1.1.4 and a LOT of us are still going with 1.1.4. Thanks.
Also I tried putting your Calibri font on 1.1.4, doesn’t work. There’s something special about it. But someone already ported the Nokia font for it, it can be done but not sure how.
September 8th, 2008 on 12:23 am
Ok, I finally got the hang of it. THANKS FOR NEOTECH 1.1.4
The guide doesn’t fully work for 1.1.4. Can you tell us what are the differences if we want to port a font to 1.1.4?
September 8th, 2008 on 9:34 pm
am trying to make DejaVuSansMono.ttf
i changed its UPM but still cant paste it to the template file (reason s not same UPM) but both is 1000 and checked the Scale all glyphs……
any solution ?
September 28th, 2008 on 1:47 am
You rock!! Sniff, sniff i love you man…
Thanks!!
October 1st, 2008 on 4:07 pm
man, u have a tutorial 4 mac os?
ive tried but cant get it
pleeeeease port carbon font for the clock font
http://www.1001freefonts.com/carbonphyber.php
thats all i need, take ur time dont hurry, pleeeeease u rock
October 5th, 2008 on 3:57 am
[...] can follow Gourav’s very complete tutorial, here: gaurav
October 5th, 2008 on 4:05 am
Since I posted on http://www.modmyi.com/forums/file-mods/265181-2-0-custom-fonts-iphone-2-0-a-3.html about some iPhone font modifications, many people asked me to write a detailed how-to; well, the truth is, I think your tutorial is very detailed and well put, so I took the liberty to redirect them here, I hope you don’t mind.
Ah, and congratulations, man, your mods are great.
October 29th, 2008 on 3:33 am
i get windows error when it hits 99% at final font generate
November 2nd, 2008 on 1:51 pm
@pulp: if you’re getting windows error and FontLab crashes when font generate reaches 99%, you must first save the project, as a .vfb file, then open that file and select generate..
November 15th, 2008 on 6:03 pm
excuse but you know how can i make for port zapfino font cause ive tried it and its impossible for me i think ive to change the metrics and dimensions but…..
December 4th, 2008 on 3:41 pm
[...] metadata will cause serious problems like app crashes or SWOD. here’s how to port fonts http://blog.gauravgiri.com/2008/08/tutorial-port-fonts-to-iphone/ this issue will be resolved in future versions of FontSwap so that fonts with incorrect metadata [...]
December 7th, 2008 on 10:47 pm
[...] can’t just copy & paste any font off your PC: gaurav’s rants
February 21st, 2009 on 2:20 am
Hi,
This is a great guide but I have problem when I am working on the LockClock.ttf, the time overwrite the date…
Anyone know what is the problem?
Thanks.
April 29th, 2009 on 9:31 am
I do not want to replace any font.
I want to add a font of just circles.
So that text converted to Kromofons,
an alphabet of colors, will appear as a string of colored circles.
See kfons.com
Highly experimental. No explainations, but everything, Everything on the site is readable.
Thanks.
Our current plugin for Outlook converts email text to kfons, but colored letters defeats the purpose. It’s the colors themselves we are reading. So we need to eliminate the letter shapes. It’s a right-brained activity. Reading is currently left-brained.
July 13th, 2009 on 1:31 am
Hi,
I tried to use FontLab Studio on Linux with Wine and it seemed to work when I replace with the special paste the glyps.
I don’t know if the number of glyps on edited Helvetica must to be the same of original one, anyway the number of glyps became more than 6000 and I cannot export this font.
Do you know if I can delete some glyps?
July 15th, 2009 on 9:49 pm
Hi man!
Thank u a lot for this amazing tutorial.. worked perfect for me!
I just got 1 question, the position of my font on the iPhone is allover a little bit too high, can I change the font-position on FontLap or would this crash my iPhone?
Thanx and best whises!
Ruda
August 18th, 2009 on 12:00 am
oi~
anybody willing to port a font for me ? this one: http://www.dafont.com/berlin-small-caps.font i would be very thankful…
(webmaster@everythingberry.com)
August 30th, 2009 on 5:33 pm
Excellent, Thank you so much for this great tutorial. One final thing was left out, how do you create preview.png to package the font?
I’d really appreciate a reply.
Kind Regards
THX
September 10th, 2009 on 3:02 am
I’m having the same problem as “TatesMan”
Any solution?
October 25th, 2009 on 10:11 pm
Hey, thanks for the great tut….I am trying to open the default font in fontlab and I am getting “The parameter is incorrect” error…also I noticed on the side that it says Python is not installed. Could that be the reason?
November 15th, 2009 on 2:18 pm
I am trying to port a font called “Sassoon Infant” which has been converted from otf to ttf.
I have spent several hours pulling my hair out because some numbers are out of alignment.
I am using 3.1.2 and FontSwap.
I am using FontLab Studio on Mac OS X.
I see many people on forums having the same problem as me but they are always ignored or told to JUST MOVE THE GLYPHS UP!?!?! The very idea of that as a solution sickens me.
The fonts that come with FontSwap (including the “Default” ones) also have this problem and it is well known but there doesn’t seem to be any new tutorials on the new way to port fonts which I find…unusual…frustrating. However, i was able to find a repo that has many 3.0 compatible fonts which are all aligned beautifully.
I have tried every porting guide that I have found and I have yet to get all the numbers aligned correctly. It is most noticeable in icon badges and the status bar clock.
I can post screenshots if anyone cares.
I don’t expect anyone to reply to this as that seems to be the way people with this problem are treated. If you haven’t guessed i’m finding this really rather depressing! Why not cheer me up by pointing out a nice shiny new tutorial that Google has failed to find for me!
November 16th, 2009 on 6:56 am
This is a really nice tutorial on getting fonts ready but it seems a little out dated. There seems to be something that must be done with the CGFontCache.plist in order for iphone 3gs to work with the new font.
I know this method still works because I can change fonts by renaming them, but I would like to add a new font all together.
Any ideas on how to properly edit the CGFontCache.plist?
Thanks.
December 24th, 2009 on 5:04 am
Thanks for this. I was able to port Perpetua thanks to your tutorial, however the process was rather painstaking in FontForge.
December 24th, 2009 on 5:06 am
“Any ideas on how to properly edit the CGFontCache.plist?”
I was wondering the same.
January 13th, 2010 on 8:47 pm
Brilliant absolutely.Great tutorial,I’ll definitely coming back to your blog.