gaurav’s rants

[Tutorial] Port Fonts to iPhone

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

  • 2. The font you want to replace on the iPhone.
  • 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/

  • 3. FontLab Studio
  • 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.]

  • 4. The desire to change things..

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.
  • 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 (3458)

    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 (3458)

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

The port process:

  • 1. Open both the default font and the custom font in FontLab Studio.
  • Arrange font windows by Window > Tile Horizontally.

  • 2. Change the UPM size of custom font to 1000.
  • Glyphs can only be copied between fonts having the same UPM size.
    Open Font Info window File > Font Info.

  • 3. Select all glyphs of custom font.
  • 4. Copy selected glyphs.

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

  • 5. Select the default font window and paste glyphs.
  • Click once in the default font window and paste the copied glyphs using Edit > Paste Special.

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

    Result:

    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.

  • 7. Generate the font.
  • 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

  • 8. Save the ported font.

  • Done. :)

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 (3458)

Be Sociable, Share!
:, , , , , , , ,

61 Comments for this entry

  • 50 recettes pour rester canon : Petits plats légers pour grandes gourmandes pdf

    Hello it’s me, I am also visiting this website regularly, this site is truly fastidious
    and the visitors are genuinely sharing nice thoughts.

  • Linette

    Here are some things that I say: What rate are you looking for.
    Some home loan companies will consider 55 per cent of
    the net monthly salary as being available for EMI payments.
    If they do have an FHA insured loan in their name that loan must have
    a Loan-to-Value (LTV) ratio of 75% or less.

  • expert web marketing

    A lot of people are considering working from the comforts of their own home via internet marketing.
    This rakes in potential customers and potential customers
    who can contribute to profitability. For example, it may take two hours and $250 to form
    an alliance with a pet shop who brings you five
    new clients per month as opposed to spending two hours and $250
    on something else that only nets one client per month.

  • ebooks

    Aw, this was an extremely nice post. Finding the time and
    actual effort to make a top notch article… but what can I say… I procrastinate a lot and never seem to get nearly anything done.

  • warren buffett sells

    A survey of the leading construction companies in Seattle’s King County Major Metropolitan Marketing Area
    (SKCMMA) conducted by the Free and Clear Press Corps and
    sponsored by the Infinite Freedom Foundation of
    King County shows an untapped fractured marketplace in the
    house cleaning industry. Dental surgery procedures come in handy to remedy these problems.
    North and South Dakota have the absolute lowest unemployment
    rates in the United states.

  • indian stock market analysis

    A survey of the leading construction companies in Seattle’s King
    County Major Metropolitan Marketing Area (SKCMMA) conducted by the Free and Clear Press Corps and sponsored by the Infinite
    Freedom Foundation of King County shows an untapped fractured marketplace in the house cleaning industry.
    You’ve bought and sold some stocks over the years
    and have made money on most of them. valuable investing or
    stock pick information there.

  • Kian

    However, at present, affecting the city public order and
    stability factors still exist in large quantities,
    and some very serious security situation in the community
    overall stable situation, the criminal cases, high, burglary, robbery and other cases of high
    potential, to a certain extent, affected the security and stability and people’s sense of security, public order situation is not optimistic.

    It is one of the most basic security elements that
    you will need to protect your home. A door alarm can be purchased for a very low price.

  • How To Read a Man Review

    We have been issuing out free product samples of supreme
    sweets. To be allowed, quite simply reply to our
    comment together with your address and we will mail it out
    over the next business day.

  • grain de cannabis

    J’aime la valeur informations que vous fournissez dans vos articles.
    Je vais Blog ett vérifier à nouveau ici régulièrement.
    Je suis vous Je vais apprejdre beaucoup d’ de nouvelles choses ici!
    Bonne chance pour la prochaine!

  • comment faire de l argent avec jingling

    Hello friends, fastidious paragraph and nice arguments commented at
    this place, I am in fact enjoying by these.

7 Trackbacks / Pingbacks for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!