From: pkwong@techbook.com (Phil Wong)
Newsgroups: comp.windows.ms
Subject: How to move TrueType fonts (long)
Summary: Hints on moving TT fonts to the directory of your choice
Keywords: Windows 3.1 TrueType fonts
Date: 17 Apr 92 04:20:55 GMT
Article-I.D.: techbook.1992Apr17.042055.17081
Organization: TECHbooks of Beaverton Oregon - Public Access Unix

If you're the type of person who likes an organized Windows 3.1 directory
structure, then this tip might be of interest to you.

As you may have noticed, the Windows setup routine places all the TrueType
(TT) fonts into the directory \WINDOWS\SYSTEM.  Not only does this make for
a crowded directory and long listings, it's also messy from an organization
point of view.  This annoyed me enough to want to move the TT fonts into
their own directory.  I thought the process would be obvious and easy, but
things didn't work out as I expected.  After experimenting for a while, I
discovered that Windows makes moving TT fonts far more difficult than it
should be.  The solution is somewhat convoluted and involved, so you may
want to read it over a few times to be fully versed.

1.  Decide in which directory you want your TT fonts to reside.
    (For this example, we'll use the directory \TTFONTS.)

2.  Copy the TT fonts from \WINDOWS\SYSTEM to \TTFONTS.  A single TT font
    consists of a font metric file (.FOT extension) and a font header file
    (.TTF extension).  You need to copy both files of each font to \TTFONTS.
    After verifying the copy process, delete the TT fonts (.FOT and .TTF)
    from the \WINDOWS\SYSTEM directory.

3.  In Windows 3.1, run the Control Panel utility.  Click the Fonts icon to
    edit the available font list.  In the Installed Fonts list box of the
    Fonts window, select all the TT fonts in the list (identifiable by the
    label "(TrueType)" next to the font name).  Just ignore the warning from
    Windows about a problem with the selected fonts.  Click the Remove
    button to remove these fonts from the font list.

4.  Click the Add button to get the Add Fonts window.  In the Directories
    list box, search for and select the \TTFONTS directory.  After a second
    or two the List of Fonts list box should show the TT fonts you copied
    over from \WINDOWS\SYSTEM. Now click the Select All button to choose all
    of them or else click on individual fonts if you want only some of them.
    Also, uncheck the box with the label "Copy Fonts to Windows Directory".
    Click OK to complete the font adding process.  Exit the Control Panel.

5.  Reboot Windows to activate your changes.  At this point the TT fonts
    should work just as they had before, so you may think you're done, right?

    Wrong.

    If you get a directory listing of \WINDOWS\SYSTEM, you will find those
    TT fonts again, even though you deleted them in Step 2 and unchecked
    the copy fonts box in Step 4!  The twist here is that only the .FOT
    files are present, with no .TTF files to be seen.  If you erase the
    .FOT files in \WINDOWS\SYSTEM, the TT fonts stop working.  If you
    delete the .FOT files in \TTFONTS, the TT fonts still work!  This would
    seem to imply that .FOT files have to stay in \WINDOWS\SYSTEM,  although
   .TTF files could reside elsewhere.  This isn't what we want at all, so
    what's going on?

    The Add Fonts option in the Control Panel insists on placing TT font
    metric files (.FOT) in \WINDOWS\SYSTEM, regardless of your wishes.
    We're stuck with this until Microsoft decides to fix it.  How do we get
    around this problem?  First of all, we have to ask this question:

       "How does Windows know the type and location of available fonts
        in the first place?"

    The answer lies in the Windows configuration file WIN.INI (found in the
    directory \WINDOWS).  If you browse WIN.INI with a text viewer, you'll
    find a section labeled "[fonts]".  This is where the Add Fonts function
    of the Control Panel does its work.  Pay particular attention to the list
    of TT fonts.  Each TT font is identified by a font name (e.g. Arial), an
    equal sign (=) separator, followed by its corresponding .FOT path.  If
    you have not yet performed Steps 1-4, then a sample line looks like:

       Arial (TrueType)=ARIAL.FOT

    The .FOT path following the font name is how Windows determines where
    to find the definition for the font's metric file.  If no explicit .FOT
    path is given, then Windows will look in \WINDOWS\SYSTEM by default.
    If you have performed Steps 1-4, then a sample line looks like:

       Arial (TrueType)=C:\WINDOWS\SYSTEM\ARIAL.FOT

    From this we can conclude that Control Panel copies the .FOT files from
    \TTFONTS back to \WINDOWS\SYSTEM and then resets WIN.INI to point to
    \WINDOWS\SYSTEM\*.FOT.  (Pretty darn silly to me.)

    Summary (up to this point):

       In WIN.INI, each TrueType font reference points to its matching
       .FOT file in \WINDOWS\SYSTEM.

6.  By now you must be thinking, "Hey, why don't I just change the .FOT path
    name from C:\WINDOWS\SYSTEM\ARIAL.FOT to C:\TTFONTS\ARIAL.FOT?"  Indeed,
    this is what you have to do next to fix the problem.  So use a *text*
    editor (such as Notepad - don't use Write) to edit WIN.INI and change
    each TT font .FOT reference from "C:\WINDOWS\SYSTEM" to "C:\TTFONTS".

    Summary (after editing WIN.INI):

       In WIN.INI, each TrueType font reference points to its matching
       .FOT file in \TTFONTS.

    Unfortunately, if you restart Windows, the TT fonts will *not* work
    (i.e. render on-screen incorrectly) any more!  Clearly, there must be
    something we're still missing.

7.  Hang on, we're almost there!  The missing element can be found by
    looking at the contents of a .FOT file with a binary editor/viewer.
    Embedded within the .FOT file is a reference to the pathname of its
    corresponding .TTF file!  The implication is that TT fonts are not
    location independent.

    Remember in Step 5 how deleting the .FOT files in \WINDOWS\SYSTEM
    caused the TT fonts to stop working while doing the same in \TTFONTS
    had no effect?  Well, running Control Panel did not merely copy the
    .FOT files from \TTFONTS to \WINDOWS\SYSTEM; it also reset the
    embedded path references in these copied files.

    Summary (up to this point):

       In WIN.INI, each TrueType font reference points to its matching
       .FOT file in \TTFONTS.

       Each .FOT file in \TTFONTS points to its corresponding (non-existent)
       .TTF file in \WINDOWS\SYSTEM.

       Each .FOT file in \WINDOWS\SYSTEM points to its corresponding .TTF
       file in \TTFONTS.
   
    What does this all mean?  It means that you have to copy the new .FOT
    (updated path) files in \WINDOWS\SYSTEM *back* to \TTFONTS to overwrite
    the original .FOT (outdated path) files.  Perform this copy procedure
    now to update the .FOT files in \TTFONTS.

    Summary (after copying files):

       In WIN.INI, each TrueType font reference points to its matching
       .FOT file in \TTFONTS.

       Each .FOT file in \TTFONTS points to its corresponding .TTF file
       in \TTFONTS.

       The .FOT files in \WINDOWS\SYSTEM are no longer needed.

8.  Finally, delete the .FOT files in \WINDOWS\SYSTEM.  Restart Windows and
    check if all the TT fonts are rendering correctly.  Congratulations,
    you have completed the moving of TT fonts from \WINDOWS\SYSTEM to
    \TTFONTS.


I hope this post helps those of you who have wondered how to move TT fonts
from where Windows wants them to where you want them.  If anyone out there
has a simpler way, please post a message so that we may all learn from
your experience.  Good luck!

- Phil Wong


Disclaimer:
    This trick worked well on my system but it may not work on yours, so
    perform the preceding procedure at your own risk.  For safety's sake,
    make backups of your WIN.INI file and TT fonts before trying your hand
    at this.
-- 
pkwong@techbook.COM  Public Access User --- Not affiliated with TECHbooks
Public Access UNIX and Internet at (503) 644-8135 (1200/2400, N81) 
Newsgroups: comp.windows.ms,comp.sys.mac.misc