This is Info file kpathsea.info, produced by Makeinfo-1.64 from the input file kpathsea.texi. START-INFO-DIR-ENTRY * Kpathsea: (kpathsea). File lookup along search paths. END-INFO-DIR-ENTRY This file documents the Kpathsea library for path searching. Copyright (C) 1993, 94, 95 Karl Berry. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "Freedom" and "GNU General Public License" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that the sections entitled "Freedom" and "GNU General Public License" may be included in a translation approved by the Free Software Foundation instead of in the original English.  File: kpathsea.info, Node: Basic glyph lookup, Next: Fontmap, Up: Glyph lookup Basic glyph lookup ------------------ When Kpathsea looks for a bitmap font NAME at resolution DPI in a format FORMAT, it first checks each directory in the search path for a file `NAME.DPIFORMAT'; for example, `cmr10.300pk'. Kpathsea looks for a PK file first, then a GF file. If that fails, Kpathsea looks for `dpiDPI/NAME.FORMAT'; for example, `dpi300/cmr10.pk'. This is how fonts are typically stored on filesystems (like DOS's) that permit only three-character extensions. If that fails, Kpathsea looks for a font with a close-enough DPI. "Close enough" is defined (by the macro `KPSE_BITMAP_TOLERANCE' in `kpathsea/tex-glyph.h') to be `DPI / 500 + 1', which is slightly more than the 0.2% allowed by the DVI standard.  File: kpathsea.info, Node: Fontmap, Next: MakeTeX... scripts, Prev: Basic glyph lookup, Up: Glyph lookup Fontmap ------- If a bitmap font is not found with the original name (see the previous section), Kpathsea looks through any "fontmap" files for an "alias" for the original font name. These files are named `texfonts.map' and are searched for along the usual glyph path. This feature is intended to help in two respects: 1. An alias name is limited in length only by available memory, not by your filesystem. Therefore, if you want to ask for `Adobe-Lucida-Bold-Sans=Typewriter' instead of `plcbst', you can. 2. A few fonts have historically had multiple names: specifically, LaTeX's "circle font" has variously been known as `circle10', `lcircle10', and `lcirc10'. Aliases can make all the names equivalent, so that it no longer matters what the name of the installed file is; TeX documents will find their favorite name. The format of fontmap files is straightforward: the first word on each line is the true filename; the second word is the alias; subsequent words are ignored. A "word" is a sequence of non-whitespace characters. Blank lines are ignored; comments start with `%' and continue to end-of-line. If an alias has an extension, it matches only those files with that extension; otherwise, it matches anything with the same root, regardless of extension. For example, an alias `foo.tfm' matches only when exactly `foo.tfm' is being searched for; but an alias `foo' matches `foo.vf', `foo.300pk', etc. As an example, here are the fontmap entries that make the circle fonts equivalent. These are in the distributed `texfonts.map' in the Web2C distribution. circle10 lcircle10 circle10 lcirc10 lcircle10 circle10 lcircle10 lcirc10 lcirc10 circle10 lcirc10 lcircle10  File: kpathsea.info, Node: MakeTeX... scripts, Next: Fallback font, Prev: Fontmap, Up: Glyph lookup `MakeTeX'... scripts -------------------- If Kpathsea cannot find a bitmap font, by either its original name or a fontmap alias, it can be configured to invoke an external program to create it. The same mechanism can be used for other nonexistent files. The script is passed the name of the file to create and possibly other arguments, as explained below. It must echo the full pathname of the file it created (and nothing else) to standard output; it can write diagnostics to standard error. * Menu: * MakeTeX... script names:: * MakeTeX... script arguments::  File: kpathsea.info, Node: MakeTeX... script names, Next: MakeTeX... script arguments, Up: MakeTeX... scripts `MakeTeX'... script names ......................... The following table shows the default name of the script for each possible file types. (The source is the variable `kpse_make_specs' in `kpathsea/tex-make.c'.) `MakeTeXPK' Glyph fonts. `MakeTeXTeX' TeX input files. `MakeTeXMF' Metafont input files. `MakeTeXTFM' TFM files. These names are overridden by an environment variable specific to the program--for example, `DVIPSMAKEPK' for Dvipsk. If a `MakeTeX...' script fails, the invocation is appended to a file `missfont.log' in the current directory. If the current directory is not writable and the environment variable `TEXMFOUTPUT' is set, its value is used. Otherwise, nothing is written.  File: kpathsea.info, Node: MakeTeX... script arguments, Prev: MakeTeX... script names, Up: MakeTeX... scripts `MakeTeX'... script arguments ............................. The first argument to a `MakeTeX'... script is always the name of the file to be created. For `MakeTeXPK', three or four additional arguments are also passed, via corresponding environment variables: 1. The dpi to make the font at (`KPATHSEA_DPI'). 2. The "base dpi" the program is operating at (`MAKETEX_BASE_DPI'), i.e., the assumed resolution of the output device. 3. A "magstep" string suitable for the Metafont `mag' variable (`MAKETEX_MAG'). 4. Optionally, a Metafont mode name to assign to the Metafont `mode' variable (`MAKETEX_MODE'). Otherwise, (the default) `MakeTeXPK' guesses the mode from the resolution. *Note TeX directory structure: TeX directory structure. 5. Optionally, a directory name. If the directory is absolute, it is used as-is. Otherwise, it is appended to the root destination directory set in the script (from environment variables `DESTDIR' or `MTP_DESTDIR' or a compile-time default). If this argument is not supplied, the mode name is appended to the root destination directory. Kpathsea sets `KPATHSEA_DPI' appropriately for each attempt at building a font. It's up to the program using Kpathsea to set the others. (*Note Calling sequence::.) You can change the specification for the arguments passed to the external script by setting the environment variable named as the script name, but all capitals--`MAKETEXPK', for example. If you've changed the script name by setting (say) `DVIPSMAKEPK' to `foo', then the spec is taken from the environment variable `FOO'. The spec can contain any variable references, to the above variables or any others you might have set. As an example, the default spec for `MakeTeXPK' is: $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE The convention of passing the name of the file to be created as the first argument cannot be changed.  File: kpathsea.info, Node: Fallback font, Prev: MakeTeX... scripts, Up: Glyph lookup Fallback font ------------- If a bitmap font cannot be found or created at the requested size, Kpathsea looks for the font at a set of "fallback resolutions". You specify these resolutions as a colon-separated list (like search paths). Kpathsea looks first for a program-specific environment variable (e.g., `DVIPSSIZES' for Dvipsk), then the environment variable `TEXSIZES', then a default specified at compilation time (the Make variable `default_texsizes'). You can set this list to be empty if you prefer to find fonts at their stated size or not at all. Finally, if the font cannot be found even at the fallback resolutions, Kpathsea looks for a fallback font, typically `cmr10'. Programs must enable this feature by assigning to the global variable `kpse_fallback_font' or calling `kpse_init_prog' (*note Calling sequence::.); the default is no such fallback font.  File: kpathsea.info, Node: TeX directory structure, Next: Programming, Prev: TeX searching, Up: Top TeX directory structure *********************** (This section obviously not really written yet; sorry. See `kpathsea/HIER'.) By default, the bitmap font paths end with `$MAKETEX_MODE', thus including the device name (i.e., the Metafont mode) in the path. This is to make it possible to distinguish two different devices with the same resolution--write/white and write/black 300dpi printers, for example. However, since most sites don't have this complication, Kpathsea (specifically, `kpse_init_prog' in `kpathsea/proginit.c') has a special case: if the mode has not been explicitly set by the user (or in a configuration file), it sets `MAKETEX_MODE' to `/'. This makes the default PK path, for example, expand into `.../pk//', so fonts will be found even if there is no subdirectory for the mode. (If your site has only one printer, for example.) To make the paths independent of the mode, simply edit `texmf.cnf.in' before installation, or the installed `texmf.cnf'. *Note Default paths::. *Note `MakeTeX'... script arguments: MakeTeX... script arguments, for how this interacts with `MakeTeXPK'.  File: kpathsea.info, Node: Programming, Next: Copying, Prev: TeX directory structure, Up: Top Programming *********** This chapter is for programmers who wish to use Kpathsea. *Note Introduction::, for the conditions under which you may do so. (If you do this, I'd appreciate a note, just to satisfy my curiousity.) * Menu: * Overview: Programming overview: Introduction. * Calling sequence:: Specifics of what to call. * Config: Programming with config files: Getting info from texmf.cnf.  File: kpathsea.info, Node: Programming overview, Next: Calling sequence, Up: Programming Programming overview ==================== Aside from this manual, your best source of information is the source to the programs I've modified to use Kpathsea (also listed in the introduction). Of those, Dviljk is probably the simplest, and hence a good place to start. Xdvik adds VF support and the complication of X resources. Dvipsk adds the complication of its own config files. Beyond these of examples of use, the `.h' files in the Kpathsea source describe the interfaces and functionality (and of course the `.c' files define the actual routines, which are the ultimate documentation). `pathsearch.h' declares the basic searching routine. `tex-file.h' and `tex-glyph.h' define the interfaces for looking up particular kinds of files. The library provides no way for an external program to register new file types: `tex-file.[ch]' must be modified to do this. For example, Kpathsea has support for looking up Dvips config files, even though obviously no program other than Dvips will ever want to do so. I felt this was acceptable, since along with new file types should also come new defaults in `texmf.cnf' (and its descendant `paths.h'), since it's best for users if they can modify one configuration file for all kinds of paths. Kpathsea does not open any files or parse any formats itself. Its purpose is only to return filenames. The GNU font utilities source does contain libraries to read TFM, GF, and PK files.  File: kpathsea.info, Node: Calling sequence, Next: Programming with config files, Prev: Programming overview, Up: Programming Calling sequence ================ The typical way to use Kpathsea in your program goes something like this: 1. Call `kpse_set_progname' with `argv[0]'; This is the only initialization that is mandatory to take full advantage of Kpathsea--specifically, for the `.PROGRAM' feature of config files (*note Config files::.). `kpse_set_progname' sets the global variables `program_invocation_name' and `program_invocation_short_name'. It also initializes debugging flags based on the environment variable `KPATHSEA_DEBUG', if that is set. set. The GNU C library provides these two global variables itself; in this case, the call to `kpse_set_program' does nothing. But you (as a software author) most likely do not want to force people installing your program to have glibc. 2. Set debugging options. *Note Debugging::. If your program doesn't have a debugging flag already, you can define one and set `kpathsea_debug' to the number that the user supplies (see Dviljk), or you can just omit this altogether (people can always set `KPATHSEA_DEBUG'). If you do have runtime debugging already, you need to merge Kpathsea's options with yours (see Dvipsk and Xdvik). 3. If your program has its own configuration files that can define search paths, you should assign those paths to the `client_path' member in the appropriate element of the `kpse_format_info' array. (This array is indexed by file type; see `tex-file.h'.) See `resident.c' in Dvipsk for an example. 4. Call `kpse_init_prog' (see `proginit.c'). It's useful for the DVI drivers, at least, but for other programs it may be simpler to extract the parts of it that actually apply. This does not initialize any paths, it just looks for (and sets) certain environment variables and other random information. (A search path is always initialized at the first call to find a file of that type; this eliminates much useless work, e.g., initializing the BibTeX search paths in a DVI driver.) 5. The routine to actually find a file of type FORMAT is `kpse_find_FORMAT', defined in `tex-file.h'. These are macros that expand to a call to `kpse_find_file'. You can call, say, `kpse_find_tfm' after doing only the first of the initialization steps above--Kpathsea will read the generic config file `texmf.cmf', look for environment variables, and do the expansions at the first lookup. 6. To find PK and/or GF bitmap fonts, the routines are `kpse_find_pk', `kpse_find_gf' and `kpse_find_glyph', defined in `tex-glyph.h'. These return a structure in addition to the resultant filename, because fonts can be found in so many ways. See the documentation in the source. Kpathsea also provides many utility routines. Some are generic: hash tables, memory allocation, string concatenation and copying, string lists, reading input lines of unlimited length, etc. Others are filename-related: default path, tilde, and variable expansion, `stat' calls, etc. (Perhaps someday I'll move the former to a separate library.) The `c-*.h' header files can also help your program adapt to many different systems. You will almost certainly want to use Autoconf for configuring your software if you use Kpathsea; I strongly recommend using Autoconf regardless. You can get it by ftp from `prep.ai.mit.edu' in `pub/gnu/autoconf-*.tar.gz', or from any of its mirrors.  File: kpathsea.info, Node: Programming with config files, Prev: Calling sequence, Up: Programming Programming with config files ============================= You can use the same `texmf.cnf' configuration file as Kpathsea for your program. This will help installers do all configuration in one place. To retrieve a value VAR, the best way is to call `kpse_var_expand' on the string `$VAR'. This will look first for an environment variable VAR, then a config file value. The result will be the value found, or the empty string. This function is declared in `kpathsea/variable.h'. If for some reason you want to retrieve a value *only* from a config file, not automatically looking for a corresponding environment variable, call `kpse_cnf_get' (declared in `kpathsea/cnf.h') with the string VAR. No initialization calls are needed.  File: kpathsea.info, Node: Copying, Next: Freedom, Prev: Programming, Up: Top GNU GENERAL PUBLIC LICENSE ************************** Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble ======== The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 1. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 2. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 3. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a. You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b. You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c. If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 4. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a. Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b. Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c. Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 5. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 6. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 7. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 8. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 9. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 10. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 11. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs ======================================================= If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. Copyright (C) 19YY NAME OF AUTHOR This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. SIGNATURE OF TY COON, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.  File: kpathsea.info, Node: Freedom, Next: Index, Prev: Copying, Up: Top Regain your programming freedom ******************************* Until a few years ago, programmers in the United States could write any program they wished. This freedom has now been taken away by two developments: software patents, which grant the patent holder an absolute monopoly on some programming technique, and user interface copyright, which forbid compatible implementations of an existing user interface. In Europe, especially through the GATT treaty, things are rapidly approaching the same pass. * Menu: * Software patents:: Algorithm monopolies. * User interface copyright:: Forbidding upward-compatibility. * What to do?:: What to do?  File: kpathsea.info, Node: Software patents, Next: User interface copyright, Up: Freedom Software patents ================ The U.S. Patent and Trademark Office has granted numerous software patents on software techniques. Patents are an absolute monopoly--independent reinvention is precluded. This monopoly lasts for seventeen years, i.e., forever (with respect to computer science). One patent relevant to TeX is patent 4,956,809, issued to the Mark Williams company on September 11, 1990, applied for in 1982, which covers (among other things) representing in a standardized order consisting of a standard binary structure file stored on auxiliary memory or transported on a communications means, said standardized order being different from a different order used on at least one of the different computers; Converting in each of the different computers binary data read from an auxiliary data storage or communications means from the standardized order to the natural order of the respective host computer after said binary data are read from said auxiliary data storage or communications means and before said binary data are used by the respective host computer; and Converting in each of the different computers binary data written into auxiliary data storage or communications means from the natural order of the respective host computer to the standardized order prior to said writing. ... in other words, storing data on disk in a machine-independent order, as the DVI, TFM, GF, and PK file formats specify. Even though TeX is "prior art" in this respect, the patent was granted (the patent examiners not being computer scientists, even less computer typographers). Since there is a strong presumption in the courts of a patent's validity once it has been granted, there is a good chance that users or implementors of TeX could be successfully sued on the issue. As another example, the X window system, which was intended to be able to be used freely by everyone, is now being threatened by two patents: 4,197,590 on the use of exclusive-or to redraw cursors, held by Cadtrak, a litigation company (this has been upheld twice in court); and 4,555,775, held by AT&T, on the use of backing store to redraw windows quickly. Here is one excerpt from a recent mailing by the League for Programming Freedom (*note What to do?::.) which I feel sums up the situation rather well. It comes from an article in `Think' magazine, issue #5, 1990. The comments after the quote were written by Richard Stallman. "You get value from patents in two ways," says Roger Smith, IBM Assistant General Counsel, intellectual property law. "Through fees, and through licensing negotiations that give IBM access to other patents. "The IBM patent portfolio gains us the freedom to do what we need to do through cross-licensing--it gives us access to the inventions of others that are the key to rapid innovation. Access is far more valuable to IBM than the fees it receives from its 9,000 active patents. There's no direct calculation of this value, but it's many times larger than the fee income, perhaps an order of magnitude larger." This information should dispel the belief that the patent system will "protect" a small software developer from competition from IBM. IBM can always find patents in its collection which the small developer is infringing, and thus obtain a cross-license. However, the patent system does cause trouble for the smaller companies which, like IBM, need access to patented techniques in order to do useful work in software. Unlike IBM, the smaller companies do not have 9,000 patents and cannot usually get a cross-license. No matter how hard they try, they cannot have enough patents to do this. Only the elimination of patents from the software field can enable most software developers to continue with their work. The value IBM gets from cross-licensing is a measure of the amount of harm that the patent system would do to IBM if IBM could not avoid it. IBM's estimate is that the trouble could easily be ten times the good one can expect from one's own patents--even for a company with 9,000 of them.  File: kpathsea.info, Node: User interface copyright, Next: What to do?, Prev: Software patents, Up: Freedom User interface copyright ======================== (This section is copied from the GCC manual, by Richard Stallman.) This section is a political message from the League for Programming Freedom to the users of the GNU font utilities. It is included here as an expression of support for the League on my part. Apple, Lotus and Xerox are trying to create a new form of legal monopoly: a copyright on a class of user interfaces. These monopolies would cause serious problems for users and developers of computer software and systems. Until a few years ago, the law seemed clear: no one could restrict others from using a user interface; programmers were free to implement any interface they chose. Imitating interfaces, sometimes with changes, was standard practice in the computer field. The interfaces we know evolved gradually in this way; for example, the Macintosh user interface drew ideas from the Xerox interface, which in turn drew on work done at Stanford and SRI. 1-2-3 imitated VisiCalc, and dBase imitated a database program from JPL. Most computer companies, and nearly all computer users, were happy with this state of affairs. The companies that are suing say it does not offer "enough incentive" to develop their products, but they must have considered it "enough" when they made their decision to do so. It seems they are not satisfied with the opportunity to continue to compete in the marketplace--not even with a head start. If Xerox, Lotus, and Apple are permitted to make law through the courts, the precedent will hobble the software industry: * Gratuitous incompatibilities will burden users. Imagine if each car manufacturer had to arrange the pedals in a different order. * Software will become and remain more expensive. Users will be "locked in" to proprietary interfaces, for which there is no real competition. * Large companies have an unfair advantage wherever lawsuits become commonplace. Since they can easily afford to sue, they can intimidate small companies with threats even when they don't really have a case. * User interface improvements will come slower, since incremental evolution through creative imitation will no longer be permitted. * Even Apple, etc., will find it harder to make improvements if they can no longer adapt the good ideas that others introduce, for fear of weakening their own legal positions. Some users suggest that this stagnation may already have started. * If you use GNU software, you might find it of some concern that user interface copyright will make it hard for the Free Software Foundation to develop programs compatible with the interfaces that you already know.  File: kpathsea.info, Node: What to do?, Prev: User interface copyright, Up: Freedom What to do? =========== (This section is copied from the GCC manual, by Richard Stallman.) To protect our freedom from lawsuits like these, a group of programmers and users have formed a new grass-roots political organization, the League for Programming Freedom. The purpose of the League is to oppose new monopolistic practices such as user-interface copyright and software patents; it calls for a return to the legal policies of the recent past, in which these practices were not allowed. The League is not concerned with free software as an issue, and not affiliated with the Free Software Foundation. The League's membership rolls include John McCarthy, inventor of Lisp, Marvin Minsky, founder of the Artificial Intelligence lab, Guy L. Steele, Jr., author of well-known books on Lisp and C, as well as Richard Stallman, the developer of GNU CC. Please join and add your name to the list. Membership dues in the League are $42 per year for programmers, managers and professionals; $10.50 for students; $21 for others. The League needs both activist members and members who only pay their dues. To join, or for more information, phone (617) 492-0023 or write to: League for Programming Freedom 1 Kendall Square #143 P.O. Box 9171 Cambridge, MA 02139 You can also send electronic mail to `league@prep.ai.mit.edu'. Here are some suggestions from the League for things you can do to protect your freedom to write programs: * Don't buy from Xerox, Lotus or Apple. Buy from their competitors or from the defendants they are suing. * Don't develop software to work with the systems made by these companies. * Port your existing software to competing systems, so that you encourage users to switch. * Write letters to company presidents to let them know their conduct is unacceptable. * Tell your friends and colleagues about this issue and how it threatens to ruin the computer industry. * Above all, don't work for the look-and-feel plaintiffs, and don't accept contracts from them. * Write to Congress to explain the importance of this issue. House Subcommittee on Intellectual Property 2137 Rayburn Bldg Washington, DC 20515 Senate Subcommittee on Patents, Trademarks and Copyrights United States Senate Washington, DC 20510 (These committees have received lots of mail already; let's give them even more.) Express your opinion! You can make a difference.