oTo - Open Type Organizer

Open Type Organizer project provides programs to list, modify
OpenType font files, specifically, their 'name' and 'cmap' tables.
It can be used to translate 'name' and 'cmap' of OpenType font
in locale encodings to Unicode encoding so the font file can be
used in environment which does not understand locale encodings.
The translated tables are added to the font while keeping the
original tables intact.

Have a True Type font which is not recognized by X Window system? 
Chances are, the font is listed/indexed in an encoding other than
Unicode!  Open Type Organizer (oTo) will help to solve the problem.
It will list font file organization and even add Unicode 'name' and
'cmap' tables by translating the original ones.  Your favorite ttf
font can really work for you now.

Summary

Have a TrueType font which is not recognized by X Window? Probably,
the font uses an encoding other than Unicode! Open Type Organizer (oTo)
can show you font info and add new 'name' and 'cmap' tables by
translating the original ones.


1.  Why oTo?

I have a collection of Chinese TrueType fonts which cannot be used
by Xft.  It turns out that those font's names are in Chinese and/or
character-to-glyphs mappings are not for Unicode.  So I wrote this
program which adds UTF-8 names and Unicode cmap to the font file.
Any other tables of the original font file is not changed.


2.  How to use oTo?

Simple.  Give font file as its arguments.

If only one font file is supplied like

    oto afont.ttf

The font's table directory and names are printed on screen.  Since
OpenType font names can be in different kind of encodings, while
output, the names are all converted to UTF-8 strings.  You can run
it in a UTF-8 capable terminal (like 'xterm') to view the result.  Or
redirect the output to a file and open it in a UTF-8 capable editor.

If two font files are supplied like

    oto afont.ttf anewfont.ttf

Then afont.ttf is converted to anewfont.ttf with UTF-8 names and Unicode
cmap added (if needed).  All the other tables are copied over without
any change.


3.  Can oTo understand encodings other than Chinese?

Right now, it can understand

    ASCII
    Unicode
    PRC GB2312-1980
    PRC GB12345-1990
    BIG5

More can be added later.


4.  Why it asked about which GB to use?

Glyphs in OpenType font for Chinese can be either in simplified form or 
traditional form.  Unfortunately, there is no information within the
font file to help us distinguishing the two.  The reliable way to find
out which form the glyphs are in is to view the glyphs using programs
like 'ftview'.  Sometimes the font names indicate the font is in simplified
form or traditional form.  But for other font files, it may not that
obvious.

If encounterd a PRC GB cmap in the font, oTo will ask you which GB
is that.  GB2312 corresponds to Simplified Chinese form and GB12345
corresponds to Traditional Chinese form.  Based on your answer, oTo
choose different table to add Unicode-to-glyphs cmap.


5.  My font's naming table is really screwed up.  How to rewrite it?

There is a little bit editing involves here.

First, dump the original naming table to a file:

    oto afont.ttf >afont.spec

Edit file afont.spec.  Cut off all other information listing in the
file except the naming table part.  Edit the name strings but leave
the lines with things like

  (Microsoft,Unicode,Chinese - PRC) ...:

alone.

Then, create a new font with the edited naming spec:

    oto afont.ttf anewfont.ttf --names afont.spec

Note you can not add new names this way.  Only modify existing ones.


6.  The naming strings don't look right.  What's wrong?

The naming strings printed on screen are in UTF-8, you should use
UTF-8 capable terminal or editor to view it.  But for some font,
the naming strings are not encoded correctly.  For example, Founder
fonts always embed GBK encoded Chinese characters in (Macintosh,Roman,English),
especially the "Trademark notice" string.  There is no way to know
that other than try to dump the naming strings in hex and spend a
lot of time to figure it out:

    oto -x afont.ttf
  
To correct the naming table of the font, see 5 above.
