1 type1inst Version 0.6.1 (11 February 1998) 2 3 Author : James Macnicol 4 5Introduction 6------------ 7 8This is the README file for the type1inst utility. type1inst makes it 9easy for you to use Type 1 fonts that don't come with your system with 10Ghostscript and/or X. It also has basic support for generating font 11sample sheets for the Type 1 fonts on your system. 12 13Note : If you are using a commercial UNIX which comes with Adobe's 14Display PostScript (DPS) system you do not need type1inst. The 15makepsres utility does what you want (with output albeit in a very 16different form). Read the manual page for more details. 17 18type1inst is distributed under the terms of the GNU General Public 19License (GPL). See the file COPYING. As such, you can use this 20program free of charge but there is no warranty. 21 22type1inst lives on the Linux archive sunsite.unc.edu in 23/pub/Linux/X11/xutils. Updates will be placed there as required. 24 25 26Warnings 27-------- 28 291. THIS IS BETA SOFTWARE! READ THE SECTION BELOW WHICH DETAILS THE 30PROGRAM'S CURRENT LIMITATIONS! 31 322. This is a long document! 33 34 35Things You Need 36--------------- 37 38There are some things you need in order to use type1inst. 39 40- An installed and working copy of GNU groff. Well, you at least need 41the "pfbtops" utility which comes with groff that is used to put the 42contents of binary PostScript font files (ones with names that end in 43.pfb) into a textual format more easily used. 44 45- The program itself is a perl script, so you will need a copy of perl 46installed. If your perl is installed somewhere else other than as 47/usr/bin/perl you will need to edit the top line of the scripts to 48specify exactly where your perl binary is located. I am using version 495.003 of perl, however I doubt it's doing anything tricky that is in 50version 5 so previous versions should work just as well. Besides, 51everything I know about the language has comes from the excellent 52"Learning Perl" book by Randal Schwartz, which is based on version 4 53of Perl. 54 55- Some Type 1 fonts you want to use (of course). These can be located 56anywhere you like and can be distributed over a number of directories 57if you want. NOTE : since X calls its font index file "fonts.scale", 58you will not be able to use fonts which are on a DOS filesystem 59(because of the stupid 8.3 file naming in the old DOS fs). It does 60work from a Windows 95 VFAT partition, though. 61 62- type1inst generates files for use with the X Window System and/or 63Ghostscript so you will want one or the other or both of these 64installed. 65 66 67Installing type1inst 68-------------------- 69 70type1inst is now distributed in two forms: a gzipped tar file that can 71be used on almost any system and also as a RPM (for RedHat Linux). 72You can tell which one you have by looking at the filename; the former 73is called type1inst-0.6.1.tar.gz, the latter is 74type1inst-0.6.1-1.i386.rpm. 75 76* For those installing from the .tar.gz file : Just copy the scripts 77named "type1inst" and "t1embed", which were created when you unpacked 78the distribution, into some convenient directory in your PATH 79(e.g. /usr/local/bin). You should probably put this README file 80somewhere safe in case you want to refer to it later. A manual page 81is now also provided which sumarizes the options the script takes (but 82is not really a subtitute for this document). Just copy 83"type1inst.man" into the appropriate directory, e.g. 84 85cp type1inst.man /usr/local/man/man1/type1inst.1 86 87(assuming, of course, that you have permission to write there). 88 89* For those installing from the RPM : Just install type1inst like any 90other RPM, i.e. rpm -i type1inst-0.6.1-1.i386.rpm. See the RPM-HOWTO 91(available on sunsite.unc.edu and its mirrors) if you need more 92information about RPM. There are no RPM packages for non-x86 Linux 93systems at this time (e.g. Alpha or SPARC). 94 95 96What type1inst can do 97--------------------- 98 99There are three main things this program can do : 100 1011. Generate the "fonts.scale" file which X uses to pick up Type 1 fonts 102which are in the current directory. X will not create this file for 103you. Previously you had to write the file by hand (which is no fun) 104but this program automates that process by extracting as much relevant 105information as it can from the font files themselves. 106 1072. type1inst can also generate entries for fonts which you can insert 108into Ghostscript's "Fontmap" configuration file. See the Ghostscript 109documentation for more info. This is used mainly to speed up 110Ghostscript's starting time, since it will go out and manually 111construct its own version of this information each time you run it if 112the Fontmap doesn't contain entries for all the fonts you want to use. 113This can take a long time if you have a lot of fonts. Using type1inst 114ensures this is only ever done once. 115 1163. You can also make font sample sheets which lay out some text on a 117page so you can see what a particular font looks like (similar, but 118not as fancy as the ones produced by version 4 of the Adobe Type 119Manager for Windows and Macintosh). 120 121 122By default, the program does items 1 and 2 above. If you want font 123sample sheets generated, use the -samples command-line switch. If, 124for some reason, you want to suppress the generation of either 125"fonts.scale" or "Fontmap", you can use the "-nox" or "-nogs" switches 126respectively. All messages can be suppressed with the "-silent" 127switch if you don't want to see them. 128 129 130Using type1inst 131--------------- 132 133NOTE: You will probably need to be root to make at least some of these 134changes. 135 136To install your fonts in X and/or Ghostscript you need to do the 137following steps for each directory in which you have fonts you want to 138use. 139 140When you are using this program for the first time, or have just 141updated the contents of a directory you need to : 142 1431. cd to the directory where your fonts are located. 144 1452. Run type1inst. If you want font sample sheets, don't forget to 146include the "-samples" switch when you run it. If this is the first 147time you have ever run the program and there are a lot of fonts then 148this can take some time. On the standard output is first printed a 149count of the total number of fonts in the directory then a count is 150printed of the number processed so far. 151 1523. If you are setting up fonts for X : 153 154A file called "fonts.scale" has been generated by type1inst which has 155then run the "mkfontdir" program to make a "fonts.dir" file (possibly 156adding information about any bitmap fonts you may have in the 157directory as well). This file contains all the information your X 158server needs in order to use the fonts. If this is the first time you 159have used this directory, you now need to tell your X server where it 160is so that it can use the fonts. How you do this depends on the 161mechanism by which the X server gets its fonts. 162 163In most cases your X server handles fonts itself, i.e. in the X server 164configuration there is information about which directories contain 165fonts which it can use. How this is done varies from implementation 166to implementation. If you are using the popular XFree86 package for 167PC UNIXes there is a file called "XF86Config" which has a section 168called "FontPath" that list all the directories in which the X server 169should look for fonts when it starts up. Add an entry in FontPath for 170your new directory and then restart the X server. The fonts should 171now be available. For other X implementations, consult your 172documentation on how to add directories to your X font path. 173 174The second (less common) way for the X server to obtain fonts is via 175an X font server, i.e. a machine running the program xfs. Note that 176xfs and the X server can be running on the same machine or on 177different machines over a network. Similar to the previous case of 178the X server which handles its own fonts, you also need to tell xfs 179where the new fonts are. The font path for xfs is listed in the 180"catalogue" section of its configuration file and this is where you 181need to add a new entry. See the xfs(1) manual page for details. 182Once you have done this restart xfs and then the new fonts should be 183available to all X servers which get their fonts from the font server. 184 185If you are updating a directory you have used previously you need only 186restart your X server or xfs to make the changes effective. 187 1884. If you are setting up fonts for use with Ghostscript : 189 190A file called "Fontmap" has been generated by type1inst in the current 191directory. Since Ghostscript has one global Fontmap file, you will 192have to use a text editor to cut and paste the entries from the 193Fontmap in the current directory into the global Fontmap (the location 194of this file is dependent on your setup, mine is in 195/usr/lib/ghostscript/3.51/Fontmap). Since the Fontmap entries do not 196contain information about which directory the fonts are installed in 197you also need to add an entry to the GS_LIB environment variable which 198specifies your font directory. When you next use Ghostscript, these 199fonts will then be available. 200 201Important : DO NOT USE THE ENVIRONMENT VARIABLE GS_FONTPATH !!! 202 203Doing this defeats the purpose of using type1inst. Regardless of what 204is in Fontmap, if you use this option Ghostscript will go out and scan 205all the fonts in the directories listed in GS_FONTPATH for itself each 206time you start it. The idea is this is only done once. 207 2085. If you asked for font sample sheets to be generated : 209 210A new directory called "samples" will have been generated with a 211series of PostScript files in it. There is one file for each font in 212the directory plus some files called "allfonts-N.ps" (N is a digit) 213which are PostScript files containing smaller samples of text from ALL 214the fonts. The single font samples are named after the real name of 215the font, not the filename in which they are stored. For example, I 216have ITC Tiepolo Book whose sample file is "samples/Tiepolo-Book.ps", 217but the font file itself is called tpw_____.pfb. 218 219There are a couple of very important points which must be made about 220the sample sheet feature. 221 222Firstly if you try to send any of these file to a PostScript printer 223as they are, chances are the output is not what you expect. type1inst 224does not embed the fonts themselves into the sample file for the 225reason that this would use up a large amount of disk space (and most 226probably you won't use them regularly anyway). If you have setup 227Ghostscript to find the fonts as described previously then you WILL be 228able to view these files correctly if you open them in Ghostview (or 229some other previewer based on Ghostscript). If you do want to print 230out the samples or view them with Ghostview (or whatever) on a machine 231where the fonts are _not_ installed then you can use the "t1embed" 232script to insert the fonts in the sample file. Simply specify the 233filenames of the samples you want with embedded fonts as arguments to 234t1embed. The current version of t1embed requires that the fonts to be 235embedded be in the current directory (i.e. it won't look in GS_LIB or 236the X font path for files). In normal usage, therefore, you will want 237to run t1embed from the directory with your fonts in it. 238 239Some examples, 240 241 t1embed samples/LucidaSans.ps samples/Tiepolo-Book.ps 242 243embeds LucidaSans and TiepoloBook into their respective sample sheets. 244 245 t1embed samples/*.ps 246 247embeds fonts in all the PostScript files in your samples directory. 248 249Note : As stated above, this is only useful if you are sending files 250directly to a PostScript printer. Printing on a non-PostScript device 251usually mean you use GhostScript -- see the section on setting up 252GhostScript's Fontmap for details on how to do this. 253 254Note 2 : Distributing PostScript files to others with complete 255embedded fonts such as t1embed creates is probably in violation of any 256font licensing agreement you have entered into. You should therefore 257keep these files for personal use only. 258 2596. A log of operations carried out by the script can be found in the 260file named "type1inst.log" in the directory in which the script was 261run. If something bad happens, look in here first for more details. 262 263 264Other Issues 265------------ 266 267There are some other things that come up when using type1inst and are 268discussed below. 269 270 271X Foundry Names 272--------------- 273 274X font names include a string denoting the foundry where the 275particular font came from. Unfortunately, it seems that there is no 276standard place this is stored in all font files. Many fonts say 277something in the /Notice string near the top of the font file, and 278indeed this is how type1inst attempts to determine the foundry name. 279For faces from large vendors like Adobe or Monotype this works fine 28099% of the time (the only exception I've seen is for ITC Korinna-Bold 281which has a typo in the spelling of "International Typeface 282Corporation" ;-) ). However, you will most probably have some fonts 283where this strategy fails. type1inst will emit a message after it has 284finished which looks something like : 285 286 287------------------------------------------------------- 288For 3 of these I couldn't figure out which foundry 289the font is from. Thus, these fonts will appear under the 290foundry unknown, i.e. X font name -unknown-*. 291Please consult the README file to see what this means. 292------------------------------------------------------- 293 294 295If you have got this far you are doing the right thing :-) 296 297If you now look in the type1inst log file "type1inst.log", you will see 298entries like : 299 300 301brakeo_.pfb (BugRake-Oblique) : foundry not matched 302 /Notice said : "BugRake was developed by Qaqaville Typography Inc." 303 304 305The first word is the filename and in brackets the name of the font in that 306file. The /Notice string is then printed. 307 308More often than not, the /Notice string doesn't have anything useful 309in it. This seems to be especially so with public domain fonts. 310You'll just have to live with it or override the foundry name manually 311(see the following section). If, however, a number of your fonts have 312similar-looking /Notice strings with a company or person's name, or 313something useful like that then you might like to send a copy of one 314of the /Notice strings to me and I'll add detection for your foundry 315into the next release. You can do this yourself by reading the 316comments near the top of the type1inst script, near the definition of 317the array @foundries. 318 319As the message says, the foundry is set to "unknown", so if you can't 320see them in "xfontsel", look there. 321 322 323Overriding Things 324----------------- 325 326Some fonts have internal font names which are a little verbose or, as 327described above, the script may not be able to determine which foundry 328a particular font comes from. An example of a verbose name is 329"Courier10PitchBT-Roman" which was donated by Bitstream to the X 330Consortium and comes with all X distributions. You might want to 331abbreviate this to "Courier10" or even "Courier". Once you have a 332valid "fonts.scale" file, you can then edit any part of the X font 333specification to be whatever you like and if you subsequently run the 334script again it will use what is already in the file, so your changes 335will be permanent. 336 337The same goes for the Fontmap; if there is already an entry 338corresponding to a particular filename, the program won't parse the 339font again, it will just keep the old name. This way you can make 340changes to the file which will be persistent. 341 342 343Current Problems/Limitations 344---------------------------- 345 346- The font samples are always re-created if you use the -samples 347option. There is no support just yet for checking to see if the font 348has changed and only generating the sample if this is true. 349 350- I consider the current font sample code to be less than ideal. As 351you will notice fonts with wide metrics (e.g. fixed width fonts like 352Courier) go over the edge of the page. The current program makes no 353attempt to determine the metrics of the font and just prints the same 354strings for each font (at the same size) whether they fit or not. It 355also doesn't make any attempt to find out what symbols are in the font. 356A future version should include a better (and more complicated) method 357for generating samples which will involve parsing an AFM file from 358Ghostscript to get the metrics and the width of each line calculated 359to ensure it fits within the boundaries of the page, as well as making 360a sample page with a complete set of available symbols. Volunteers to 361do this are welcome (I have some code if anyone is interested finishing 362it). 363 364- The script won't yet work on anything which doesn't look like a Unix 365since it needs system commands like "mv", "rm" etc. I'll fix this if 366people using other systems are interested. 367 368- The public domain Hershey fonts which are distributed with Ghostscript 369don't have the structure of normal fonts and are ignored. 370 371- Having _lots_ of fonts causes xfontsel's list of fonts to be about five 372screens high :-( [ not my fault ! ] I've been told that if you replace 373libXaw with "libneXtaw" (location unknown....) then the list will scroll. 374 375- Don't throw away all your bitmap fonts yet. It seems there is more 376than one way to write font names in X and some applications 377(e.g. xmcd) can't match the fonts they want with anything this program 378generates. It looks like you can have less fields in the font 379specification. I really don't know much about this (need an Xpert). 380Perhaps we need to automatically generate aliases or something. 381 382e.g. 383 384artifacts(0):~# xmcd& 385[1] 10958 386artifacts(0):~# Warning: Cannot convert string "-*-helvetica-medium-r-*--10-100-*" to type FontStruct 387Warning: Cannot convert string "-*-helvetica-medium-o-*--24-240-*" to type FontStruct 388Warning: Cannot convert string "-*-helvetica-bold-o-*--14-140-*" to type FontStruct 389Warning: Cannot convert string "-*-helvetica-bold-o-*--12-120-*" to type FontStruct 390Warning: Cannot convert string "-*-helvetica-bold-r-*--12-120-*" to type FontStruct 391Warning: Cannot convert string "-*-helvetica-*-o-*--14-140-*" to type FontStruct 392Warning: Cannot convert string "-*-helvetica-medium-r-*--12-120-*" to type FontStruct 393Warning: Cannot convert string "-*-times-bold-i-*--24-240-*" to type FontStruct 394Warning: Cannot convert string "-*-times-bold-i-*--12-120-*" to type FontStruct 395 396 397It would appear to be something to do with the 24-240 bit. I can't 398seem to select these in xfontsel (but this is a scalable font so you 399should be able to get all sizes....????) 400 401- Some users in the past reported problems with file globbing not 402working, which resulted in the program saying that there are no fonts 403in a given directory even though there were some. I don't know why 404this is. The code now spawns a shell to globbing on behalf of 405type1inst which I hope will solve the problem, the logic being if your 406shell's globbing is broken then you will have to fix it (unlike perl 407which you might not use for anything else). I have my suspicions 408regarding the various versions of the Linux libc which breaks bits and 409pieces inside perl. Please let me know if the problem persists. 410 411 412Contacting the Author 413--------------------- 414 415If you find a problem with this program or you would like to make a 416suggestion, or whatever, feel free to e-mail me. My address is 417 418james.macnicol@mailexcite.com 419 420Note that this address has changed (as of version 0.6.1). It's on one 421of those free e-mail services because I've finished my university 422study and I don't know where my preferred e-mail address will be after 423that. 424 425 426Thanks! 427------- 428 429My thanks go to the following people for submitting feedback and/or 430code (names in alphabetical order) : 431 432- Jouni Ahto <jah@pirecraft.fi> 433 434 For cleaning up and greatly expanding the font name/style 435etc. checking, making it do the right thing in far more cases than it 436used to (although it seems we will never get the font foundries to lay 437things out in a standard way so it won't always work 100% right). 438 439- Jim Diamond <zsd@axe.nstn.ca> 440and (independently) 441- Pete Schwamb <pete@basho.rconnect.com> 442 443 For contributing foundry description for Corel's fonts. 444 445- Andreas Dilger <adilger@enel.ucalgary.ca> 446 447 For writing and enhancing the font sample code, many suggestions 448and foundry names too. 449 450- Andrew Fitzhugh <fitzhugh@hpl.hp.com> 451 452 For pointing out that pfbtops wasn't from Ghostscript at all, but 453from groff. 454 455- Elliot Lee <sopwith@circ.us.eu.org> 456 For contributing code that copes with compressed fonts and deals with 457/FontName (foo) def in the font files. 458 459- Daniel Morrison <draker@cug.concordia.ca> 460 461 For reporting problems with file globbing and providing code to fix 462it. 463 464- James A. Robinson <jimr@simons-rock.edu> 465 466 For foundry information on lots of public domain fonts. 467 468- Robin Stephenson <robin@gbhap.com> 469 470 For a whole bunch of foundries seen in the Fontographer distribution. 471 472- David Stern <kotsya@u.washington.edu> 473 474 For intelligence regarding xfontsel and scrolling lists of fonts. 475 476- Stefan Wille <wille@kew.netlife.de> 477 478 For "Allied Corporation" foundry.