a font family renamer utility

Typograph's picture

I am looking for a utility that allows me to change the actual family names of fonts.
assume i had 100 fonts, and i want to givr all of the a prefix so they all group up in the font menu.
say i had a family name
XXX regular
XXX Bold
XXX Heavy

And i want them all to be
PFxxx Regular
PFxxx Bold
PFxxx Heavy and so on.

i am not talking about a utility that renames the ttf file such as the family name but actualy changing at once the font internal name
1. family name
2. sub family name
3 full name

Thomas Phinney's picture

Mac, Windows, both? Does it have to work on PostScript Type 1, or just TTF/OTF?

Cheers,

T

Typograph's picture

Win Platform
mainly TTF and if posible OTF

----------------------------------------------------------------------
BTW
C++ Or Delphi Code (function) would serve me great if posible.

I tried to studie the TTF format from microsoft documentation but could'n get it to work properly. and could not find source code on the net.

If i could get my hand on two basic functions somthing like
Procedure ReadFontName (var FontName,FullName ,FamilyName:LongString);
Procedure WriteFontname(FontName,FullName ,FamilyName:LongString);

I would be able to manipulate these functions axactly to my needs;

Theunis de Jong's picture

At what point did you get stuck on writing your own program?

All of those strings are in the 'name' table -- one of the easier tables, although there are two layers to each string (encoding and language).

After changing something in this (or any) table, you have to recalculate the checksum of that table alone and of the entire file; the exact procedure is outlined in MS's documentation, with sample code in C.

Anyhow, perhaps it's easier to use TTX: expand font to XML, change strings, recompile into font.

Thomas Phinney's picture

That's exactly what I was about to suggest. TTX can do lossless round-tripping of TTF/OTF, though it works best if one goes through the pain of installing version 1.3 (due to compatibility with latest version of OS/2 table).

Note also that the name table can have multiple versions of any given name string. One usually has both Mac and Windows versions for almost every nameID, and occasionally one sees different versions for different languages.

Cheers,

T

Typograph's picture

to recompile the font i can sinmly open each font in fontlab and do the same.

in ttf format things seem simpler to code, but the same procedure on otf generates a font that wooun't install.

I managed to write code that reads the font info correctly, But when trying to write back somthing goes worng.

I use methodes of direct win API to read write the file (delphiws read/write dose not seem to work the same, may be it deals with handles diffrently but cold not understanf why, binary data should be binary data, no???, (BlockRead, BlockWrite works better, but still with direct API functions i get less errors, WEIRD)).

maybe somthing gows wrong with the CheckSum, I doln't know, but i am not managing to fully understand the TTF\OTF file format.

I thought that the differnce of TTF vs OTF is only Records and enteries after the end of the file (of the TTF) but seems that OTF have Some differnt headers

maybe 16\32 bit variabls - Byte -> DoubleByte ||| Word -> LongWord.

TTX:
I cound never get the FontForge To work on my computer properly, (I use Phontographer 5 & FontLab 5)+ I don't know python (I should get in to it sometime soon i guess).

however font-format is not common knowledge.

Mark Simonson's picture

TTX is great and well suited to the kind of thing you want to do. You might also look at DTL's OTMaster, which has similar capabilities, but with a graphical user interface, and any editing is done within the app, rather than with a text editor. Here's a link: http://www.fontmaster.nl/english/OTMaster_rdrct.html

Theunis de Jong's picture

TTX is install-and-run -- no FontForge nor Python needed.

Thomas Phinney's picture

No, TTX does require Python. It does not, however, require FontForge. Now, on OS X Python is usually pre-installed, so that may be a no-op.

One big reason to use TTX is that it is lossless. Decompiling with FontLab and exporting a font out is not lossless.

Writing your own apps to do this is really quite complicated. I know somebody who thought fonts were simple data structures and surely he could write an app to do what he wanted (similar kinds of manipulations, mostly to the name table). After spending about 20-40 hours of looking into it he realized that I was quite correct, and it wasn't worth writing an app from scratch.

Cheers,

T

Syndicate content Syndicate content