[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 (383)
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 (383)
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 (383)

















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