Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse Search

Direc­tory tex-archive/fonts/utilities/TrueTypeToType42

TrueType Font to PostScript Type 42 Con­ver­sion

Us­ing Pro­gram TrueTypeToType42.ps

TrueType fonts are widely avail­able but can­not be used di­rectly in cur­rent ver­sions of PostScript, lev­els 1 through 3, al­though, with Adobe's in­tro­duc­tion of Open Type fonts, that may change in the fu­ture. To over­come this, sev­eral pro­grams have been writ­ten which cre­ate a PostScript Type 1 font from a TrueType font.

With level 2.013 PostScript, Adobe in­tro­duced a new font cat­e­gory, Type 42, which is, to use Adobe's own words, a TrueType font wrapped in some PostScript code. Ac­tu­ally the com­plex­ity of the con­ver­sion is con­sid­er­ably more than the word wrapped im­plies and, al­though the pre­pon­der­ant view is that the use of Type 42 gives bet­ter printed out­put than con­ver­sion to Type 1, few pro­grams for the con­ver­sion to Type 42 ex­ist.

This doc­u­ment de­scribes the use of the PostScript pro­gram TrueTypeToType42.ps to gen­er­ate the equiv­a­lent PostScript Type 42 font file from a TrueType font file. The ac­tual work of wrap­ping is done by the GhostScript pro­ce­dure .loadt­t­font and this pro­gram sim­ply op­er­ates on the re­sult­ing file. I don't know when .loadt­t­font was in­tro­duced into GhostScript but I de­vel­oped this pro­gram us­ing ver­sion 6.5 and am now us­ing it with ver­sion 7.0.

Pre­lim­i­nar­ies

You will prob­a­bly wish to make two mi­nor changes to the pro­gram be­fore run­ning it.

  • The value of the key /Path is the folder where the out­put files will be cre­ated. It is cur­rently set to D:\Temp and you may wish change it. Search for /Path and change its value mak­ing sure you re­tain the paren­the­ses en­clos­ing it. Note that this folder must al­ready ex­ist, the pro­gram will not cre­ate it for you.
  • The set­pagede­vice dic­tio­nary is set for sim­plex print­ing from tray 3. You will prob­a­bly wish to change these to suit your printer. In your ed­i­tor, search for set­pagede­vice and change the value of /Du­plex to true and the value of /Me­di­aPo­si­tion to what­ever suits you printer.

Run­ning the pro­gram

TrueTypeToType42.ps is run un­der GhostScript from the com­mand prompt with the com­mand line:

<Full path name of GhostScript executable>

-I<Full path to the GhostScript main folder>

-- <Full path name of the conversion program?

<Full path name of the TrueType font?

Note

  • This is a single command line, it has been folded into four parts because of its great length.
  • The double hyphen at the start of the third line is part of the command.
  • The program will not run under GhostView.

Output files

The program generates three files, all in a folder of your choice (see Preliminaries above). The files are:

  • The Type 42 equivalent of the TrueType font. The root name of this file is the PostScript name of the font and its extension is .pfa. For example, the name of the font defined by the TrueType file times.ttf is TimesNewRomanPSMT and the name of its Type 42 equivalent is TimesNewRomanPSMT.pfa. The length of the Type 42 file is about twice that of the TrueType original. As the .pfa extension implies, the Type 42 file can be treated as any other .pfa file.
  • A PostScript file called ShowAllGlyphs.ps which will display under GhostView or cause a PostScript printer to print a table of all the glyphs defined by the font alongside their names. This file contains a copy of the Type 42 font file in its prologue so that it is self contained and can be displayed in GhostView or printed without downloading the font.
  • A report on the operation of the program in file TrueTypeToType42.out.

The folder into which these files are placed is defined in the setup section of the program as the value of the key /Path. This must be set to suit your system. Go to the program line %%BeginSetup. After it you will find a few lines of comments and the line in question. Modify the contents of the string being careful to maintain the parentheses enclosing it. Note that the folder must already exist, the program will not create it for you.

Since TrueTypeToType42.ps is a PostScript file, it should run on any platform, i.e. Unix, Linux, Macs, PCs, provided there is a recent version of GhostScript installed. I am not sure of the precise meaning of recent but I have run the program under GhostScript 6.5 and 7.0.

The Type 42 file has the extension .pfa and can be treated as a normal .pfa file. For example:

  • The font can be renamed by changing the value of the /FontName key.
  • The font can be reencoded by changing its Encoding vector.
  • The font file can be included in a PostScript file.
  • The font file can be stored on a printer hard disk.

Running under Windows

What follows is a description of the way I run TrueTypeToType42 on my system which is a PC under Windows 2000. I hope they will provide pointers to its use in other systems.  I am cur­rently us­ing GhostScript 7.00.

Stor­ing the TrueType files

A large num­ber of TrueType fonts came with my copy of Win­dows 2000. They are by de­fault placed in folder C:\Winnt\Fonts. This folder has spe­cial prop­er­ties for work­ing with the Win­dows font soft­ware and I have found it more con­ve­nient to keep a copy of all TrueType fonts in folder C:\TrueTypeFonts and to con­vert them from there.

My com­mand line

My com­mand line is:

C:\GS\GS7.00\bin\gswin32 -IC:\GS\GS7.00

-- D:\Fonts\TrueType\Util­i­ties\TrueTypeToType42.ps

C:\TrueTypeFonts\<name of the TrueType font file>

To get round the great length of this command, I have created a batch file called TTF2T42WE.bat. This can be run from the Windows command prompt but I find it more convenient to run it from within Windows Explorer.

Running from the command prompt

To run it from the Windows command prompt, first place a copy of TTF2T42WE.bat in a folder on your path. I have it in C:\BatchFiles. Then, at the comman prompt, enter TTF2T42WE followed by the full path name of the TrueType font to be converted. Pressing Enter will then start the program and create the three output files. If the current folder is the one containing the TrueType file, you can enter only the name of the TrueType file rather than its full path name.

Running in Windows Explorer

If you prefer to operate from Windows Explorer, as I do, place a copy of TTF2T42WE.bat in your SendTo folder which in my case is:

C:\Documents and Settings\Thomas H. Barton\SendTo

To use this batch file:

  1. Start Windows Explorer.
  2. Move to the folder containing the TrueType file.
  3. Right click on the TrueType file. This displays a list of activities.
  4. On this list, left click on SendTo to display another list of activities one of which is TTF2T42WE.
  5. Left click on TTF2T42WE. This invokes the conversion program. The three output files are placed in the folder specified by the /Path key in TrueTypeToType42.ps.

Thomas H. Barton, April 2002

thbarton@shaw.ca

Files

Name Size Date Notes
ReadMe.html 7750 2002-04-14 06:32
ReadMe.txt 6745 2002-04-14 06:19
TTF2T42WE.bat 3764 2002-04-10 06:39
TrueTypeToType42.ps 27115 2002-04-14 06:35

Down­load the con­tents of this pack­age in one zip archive (14.5k).

TrueTypeToType42 – Gen­er­ate a Type 42 font from a TrueType font

The pack­age pro­vides a PostScript pro­gram, to run un­der ghostscript, that will read a TrueType font and pro­duce an Adobe Type 42 (PFA) font as out­put.

Pack­age De­tailsTrueTypeToType42
Ver­sion 2002-04-30
Li­censeUn­known Sta­tus, No In­for­ma­tion Avail­able
Main­tainerThomas H. Bar­ton
Topics pro­cess fonts for use with TeX (in­cludes in­stal­la­tion)
Guest Book Sitemap Contact