The TTIComp tool lets you add instructions to a TrueType font through a .TTI file containing something that looks like C code. You will need to know some C and to know something about TrueType instructions. You can take a look at the examples, and browse the tutorial for more information.


This is an example of what a TTI file may look like:

// This is the instruction file for Garogier.ttf

#input "../Garogier.ttf"
#output "Garogier_hinted.ttf"

#gasp AI
#twilight 1
#stack 100

#cvt base30: -30 \
    xHeight30: 830 \
    difference30: 30 \
    stemBegin: \
    stem40: 40 stem150: 150 \
void prep() {
    fixed oldXHeight = getCVT(xHeight);
    fixed newXHeight = roundBlack(oldXHeight);
    setCVT(xHeight, newXHeight);
    fixed diff30 = getCVT(difference30);

    if (getPPEM() < 40u) {
        setCVT(base30, 0.0);
        setCVT(xHeight30, newXHeight);       
    } else {
        setCVT(xHeight30, newXHeight + diff30);
    uint ppemY = getPPEM();
    if (getPPEM() > ppemY)

    // pixel size stems
    while (cur < stemEnd) {
        fixed size = getCVT(cur);
        const fixed attenuation = .5;
        if (size<2.0)
            size = size*((2.0-attenuation)/2.0) + attenuation;
        setCVT(cur, size);
        cur = cur + 1u;

/*** figures ***/

void zero() {
    moveDistanceBlack(1u,1u, 1u,23u, stem150);
    moveDistanceRoundGrey(1u,1u, 1u,7u);
    moveDistanceBlack(1u,7u, 1u,17u, stem150);
    // rsb
    moveDistanceRoundWhite(1u,7u, 1u,25u);
    movePoint(1u,10u, base30);
    moveDistanceBlack(1u,10u, 1u,14u, stem40);
    movePoint(1u,4u, xHeight30);
    moveDistanceBlack(1u,4u, 1u,20u, stem40);

If this does not scare you, but rather interests you, you may want to take a look at these files, which include source .TTF and .TTI files for two fonts made by me (but not finished yet).


You may download a MS Windows binary (i.e., a working program file) of TTIComp here. It has been confirmed to work on Windows 2000 and Windows 95; other 32 bit Windowses (98, ME, XP etc.) should work as well. The source is also available.