From: georgem@microsoft.com (George Moore)
Subject: Re: Changing Font Names in Windows
Date: 22 Aug 92 17:03:29 GMT
Organization: Microsoft Corporation
Distribution: usa

In article <6642@tekig7.PEN.TEK.COM> duanem@tekig5.pen.tek.com writes:
>Chris clearly stated that he is referring to Corel DRAW 3.0, which uses
>TrueType fonts.  Previous versions of Corel DRAW have included information
>regarding changing of font names.  In those versions, the change was known
>ONLY to Corel DRAW.  But since version 3.0 provides all those fonts which
>can be shared with virtually all other Windows applications, it is very
>desirable to change the names of the True Type fonts to the names that we
>all know them by.  I'd like the answer also.

The name that is encoded in a TrueType font is stored in the 'name'
table as a series of length-encoded strings.  Technically it is
possible to change the names, but legally it is not.  Fonts are only
protected by their copyrighted names and by changing these "clone"
names to "real" names you are doing a disservice to the font foundry
who actually owns the trademark and/or copyright.  If you would, as
you say, "like to change the names to something we all know them by",
why not just go out and buy the real thing?

But enough of this debate.  Since you asked the question, I'll try
to answer it with the above warning in place.

A TrueType font is a series of discreet tables that can contain
all sorts of information, and all tables are referenced by a table
directory at the very beginning of the font.  This directory shows
the table name, length and offset into the file.  The 'name' table
generally contains two entries: names to use in the Macintosh and
names to use in Windows.  The only major difference between the two
entries are that the Mac names contain 8-bit strings, whereas the 
Windows names are 16-bit Unicode strings.  There is a wealth of
information stored in the name table that is generally not accessible
under applications on Windows or the Mac.  The string type entries 
are:

	1. Font Family Name	("Times New Roman")
	2. Font Subfamily Name	("Bold")
	3. Unique Name		("Times New Roman Bold: Monotype")
	4. Full Font Name	("Times New Roman Bold")
	5. Version		("MS Core Font: 1.00")
	6. Copyright		("Copyright 1992 Monotype plc")
	7. Trademark		("Times New Roman is a registered 
				  trademark of Monotype plc")

You will also find that name ID #2 will appear in localized format
(in the Microsoft fonts at least) in over 10 difference languages
(e.g., "Gras Italique" in France for "Bold Italic").

Changing these names will be difficult at best without a custom
tool to do so.  This is because the length of each string, the
length of the entire table, not to mention the checksum of the
table are all stored mixed in with the string data.  There is
example source code to parse this name table available for
anonymous FTP in ftp.uu.net in the /vendor/microsoft/TrueType-Info
directory.  See the "readme.txt" file for more info on the stuff
in that directory.  Note that the example sources only read the
name table, not provide a way to change it.  The rest is left as
an exercise for the reader. :-)

-George Moore, TrueType Guy
 (georgem@microsoft.com)
Xref: sparky comp.fonts:2403 comp.text.tex:10323 comp.os.ms-windows.misc:2170