home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-bin0.lha / info / kpathsea.info-2 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  45.0 KB  |  999 lines

  1. This is Info file kpathsea.info, produced by Makeinfo-1.64 from the
  2. input file /ade-src/contrib/unixtex/kpathsea/kpathsea.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Kpathsea: (kpathsea).        File lookup along search paths.
  6. END-INFO-DIR-ENTRY
  7.  
  8.   This file documents the Kpathsea library for path searching.
  9.  
  10.   Copyright (C) 1993, 94, 95 Karl Berry.
  11.  
  12.   Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.   Permission is granted to copy and distribute modified versions of this
  17. manual under the conditions for verbatim copying, provided also that the
  18. sections entitled "Freedom" and "GNU General Public License" are
  19. included exactly as in the original, and provided that the entire
  20. resulting derived work is distributed under the terms of a permission
  21. notice identical to this one.
  22.  
  23.   Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "Freedom" and "GNU General
  26. Public License" may be included in a translation approved by the Free
  27. Software Foundation instead of in the original English.
  28.  
  29. 
  30. File: kpathsea.info,  Node: Basic glyph lookup,  Next: Fontmap,  Up: Glyph lookup
  31.  
  32. Basic glyph lookup
  33. ------------------
  34.  
  35.   When Kpathsea looks for a bitmap font NAME at resolution DPI in a
  36. format FORMAT, it first checks each directory in the search path for a
  37. file `NAME.DPIFORMAT'; for example, `cmr10.300pk'.  Kpathsea looks for
  38. a PK file first, then a GF file.
  39.  
  40.   If that fails, Kpathsea looks for `dpiDPI/NAME.FORMAT'; for example,
  41. `dpi300/cmr10.pk'. This is how fonts are typically stored on
  42. filesystems (like DOS's) that permit only three-character extensions.
  43.  
  44.   If that fails, Kpathsea looks for a font with a close-enough DPI.
  45. "Close enough" is defined (by the macro `KPSE_BITMAP_TOLERANCE' in
  46. `kpathsea/tex-glyph.h') to be `DPI / 500 + 1', which is slightly more
  47. than the 0.2% allowed by the DVI standard.
  48.  
  49. 
  50. File: kpathsea.info,  Node: Fontmap,  Next: MakeTeX... scripts,  Prev: Basic glyph lookup,  Up: Glyph lookup
  51.  
  52. Fontmap
  53. -------
  54.  
  55.   If a bitmap font is not found with the original name (see the previous
  56. section), Kpathsea looks through any "fontmap" files for an "alias" for
  57. the original font name.  These files are named `texfonts.map' and are
  58. searched for along the usual glyph path.
  59.  
  60.   This feature is intended to help in two respects:
  61.  
  62.   1. An alias name is limited in length only by available memory, not
  63.      by your filesystem.  Therefore, if you want to ask for
  64.      `Adobe-Lucida-Bold-Sans=Typewriter' instead of `plcbst', you can.
  65.  
  66.   2. A few fonts have historically had multiple names: specifically,
  67.      LaTeX's "circle font" has variously been known as `circle10',
  68.      `lcircle10', and `lcirc10'.  Aliases can make all the names
  69.      equivalent, so that it no longer matters what the name of the
  70.      installed file is; TeX documents will find their favorite name.
  71.  
  72.  
  73.   The format of fontmap files is straightforward: the first word on each
  74. line is the true filename; the second word is the alias; subsequent
  75. words are ignored.  A "word" is a sequence of non-whitespace
  76. characters.  Blank lines are ignored; comments start with `%' and
  77. continue to end-of-line.
  78.  
  79.   If an alias has an extension, it matches only those files with that
  80. extension; otherwise, it matches anything with the same root,
  81. regardless of extension.  For example, an alias `foo.tfm' matches only
  82. when exactly `foo.tfm' is being searched for; but an alias `foo'
  83. matches `foo.vf', `foo.300pk', etc.
  84.  
  85.   As an example, here are the fontmap entries that make the circle fonts
  86. equivalent. These are in the distributed `texfonts.map' in the Web2C
  87. distribution.
  88.  
  89.      circle10    lcircle10
  90.      circle10    lcirc10
  91.      lcircle10    circle10
  92.      lcircle10    lcirc10
  93.      lcirc10        circle10
  94.      lcirc10        lcircle10
  95.  
  96. 
  97. File: kpathsea.info,  Node: MakeTeX... scripts,  Next: Fallback font,  Prev: Fontmap,  Up: Glyph lookup
  98.  
  99. `MakeTeX'... scripts
  100. --------------------
  101.  
  102.   If Kpathsea cannot find a bitmap font, by either its original name or
  103. a fontmap alias, it can be configured to invoke an external program to
  104. create it.  The same mechanism can be used for other nonexistent files.
  105.  
  106.   The script is passed the name of the file to create and possibly other
  107. arguments, as explained below.  It must echo the full pathname of the
  108. file it created (and nothing else) to standard output; it can write
  109. diagnostics to standard error.
  110.  
  111. * Menu:
  112.  
  113. * MakeTeX... script names::
  114. * MakeTeX... script arguments::
  115.  
  116. 
  117. File: kpathsea.info,  Node: MakeTeX... script names,  Next: MakeTeX... script arguments,  Up: MakeTeX... scripts
  118.  
  119. `MakeTeX'... script names
  120. .........................
  121.  
  122.   The following table shows the default name of the script for each
  123. possible file types.  (The source is the variable `kpse_make_specs' in
  124. `kpathsea/tex-make.c'.)
  125.  
  126. `MakeTeXPK'
  127.      Glyph fonts.
  128.  
  129. `MakeTeXTeX'
  130.      TeX input files.
  131.  
  132. `MakeTeXMF'
  133.      Metafont input files.
  134.  
  135. `MakeTeXTFM'
  136.      TFM files.
  137.  
  138. These names are overridden by an environment variable specific to the
  139. program--for example, `DVIPSMAKEPK' for Dvipsk.
  140.  
  141.   If a `MakeTeX...' script fails, the invocation is appended to a file
  142. `missfont.log' in the current directory. If the current directory is
  143. not writable and the environment variable `TEXMFOUTPUT' is set, its
  144. value is used. Otherwise, nothing is written.
  145.  
  146. 
  147. File: kpathsea.info,  Node: MakeTeX... script arguments,  Prev: MakeTeX... script names,  Up: MakeTeX... scripts
  148.  
  149. `MakeTeX'... script arguments
  150. .............................
  151.  
  152.   The first argument to a `MakeTeX'... script is always the name of the
  153. file to be created.
  154.  
  155.   For `MakeTeXPK', three or four additional arguments are also passed,
  156. via corresponding environment variables:
  157.  
  158.   1. The dpi to make the font at (`KPATHSEA_DPI').
  159.  
  160.   2. The "base dpi" the program is operating at (`MAKETEX_BASE_DPI'),
  161.      i.e., the assumed resolution of the output device.
  162.  
  163.   3. A "magstep" string suitable for the Metafont `mag' variable
  164.      (`MAKETEX_MAG').
  165.  
  166.   4. Optionally, a Metafont mode name to assign to the Metafont `mode'
  167.      variable (`MAKETEX_MODE').  Otherwise, (the default) `MakeTeXPK'
  168.      guesses the mode from the resolution.  *Note TeX directory
  169.      structure: TeX directory structure.
  170.  
  171.   5. Optionally, a directory name. If the directory is absolute, it is
  172.      used as-is. Otherwise, it is appended to the root destination
  173.      directory set in the script (from environment variables `DESTDIR'
  174.      or `MTP_DESTDIR' or a compile-time default). If this argument is
  175.      not supplied, the mode name is appended to the root destination
  176.      directory.
  177.  
  178.  
  179. Kpathsea sets `KPATHSEA_DPI' appropriately for each attempt at building
  180. a font.  It's up to the program using Kpathsea to set the others.
  181. (*Note Calling sequence::.)
  182.  
  183.   You can change the specification for the arguments passed to the
  184. external script by setting the environment variable named as the script
  185. name, but all capitals--`MAKETEXPK', for example.  If you've changed
  186. the script name by setting (say) `DVIPSMAKEPK' to `foo', then the spec
  187. is taken from the environment variable `FOO'.
  188.  
  189.   The spec can contain any variable references, to the above variables
  190. or any others you might have set.  As an example, the default spec for
  191. `MakeTeXPK' is:
  192.  
  193.      $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE
  194.  
  195. The convention of passing the name of the file to be created as the
  196. first argument cannot be changed.
  197.  
  198. 
  199. File: kpathsea.info,  Node: Fallback font,  Prev: MakeTeX... scripts,  Up: Glyph lookup
  200.  
  201. Fallback font
  202. -------------
  203.  
  204.   If a bitmap font cannot be found or created at the requested size,
  205. Kpathsea looks for the font at a set of "fallback resolutions".  You
  206. specify these resolutions as a colon-separated list (like search paths).
  207. Kpathsea looks first for a program-specific environment variable (e.g.,
  208. `DVIPSSIZES' for Dvipsk), then the environment variable `TEXSIZES',
  209. then a default specified at compilation time (the Make variable
  210. `default_texsizes').  You can set this list to be empty if you prefer
  211. to find fonts at their stated size or not at all.
  212.  
  213.   Finally, if the font cannot be found even at the fallback resolutions,
  214. Kpathsea looks for a fallback font, typically `cmr10'.  Programs must
  215. enable this feature by assigning to the global variable
  216. `kpse_fallback_font' or calling `kpse_init_prog' (*note Calling
  217. sequence::.); the default is no such fallback font.
  218.  
  219. 
  220. File: kpathsea.info,  Node: TeX directory structure,  Next: Programming,  Prev: TeX searching,  Up: Top
  221.  
  222. TeX directory structure
  223. ***********************
  224.  
  225.   (This section obviously not really written yet; sorry.  See
  226. `kpathsea/HIER'.)
  227.  
  228.   By default, the bitmap font paths end with `$MAKETEX_MODE', thus
  229. including the device name (i.e., the Metafont mode) in the path.  This
  230. is to make it possible to distinguish two different devices with the
  231. same resolution--write/white and write/black 300dpi printers, for
  232. example.
  233.  
  234.   However, since most sites don't have this complication, Kpathsea
  235. (specifically, `kpse_init_prog' in `kpathsea/proginit.c') has a special
  236. case: if the mode has not been explicitly set by the user (or in a
  237. configuration file), it sets `MAKETEX_MODE' to `/'.  This makes the
  238. default PK path, for example, expand into `.../pk//', so fonts will be
  239. found even if there is no subdirectory for the mode.  (If your site has
  240. only one printer, for example.)
  241.  
  242.   To make the paths independent of the mode, simply edit `texmf.cnf.in'
  243. before installation, or the installed `texmf.cnf'.  *Note Default
  244. paths::.
  245.  
  246.   *Note `MakeTeX'... script arguments: MakeTeX... script arguments, for
  247. how this interacts with `MakeTeXPK'.
  248.  
  249. 
  250. File: kpathsea.info,  Node: Programming,  Next: Copying,  Prev: TeX directory structure,  Up: Top
  251.  
  252. Programming
  253. ***********
  254.  
  255.   This chapter is for programmers who wish to use Kpathsea. *Note
  256. Introduction::, for the conditions under which you may do so. (If you
  257. do this, I'd appreciate a note, just to satisfy my curiousity.)
  258.  
  259. * Menu:
  260.  
  261. * Overview: Programming overview:     Introduction.
  262. * Calling sequence::             Specifics of what to call.
  263. * Config: Programming with config files:    Getting info from texmf.cnf.
  264.  
  265. 
  266. File: kpathsea.info,  Node: Programming overview,  Next: Calling sequence,  Up: Programming
  267.  
  268. Programming overview
  269. ====================
  270.  
  271.   Aside from this manual, your best source of information is the source
  272. to the programs I've modified to use Kpathsea (also listed in the
  273. introduction). Of those, Dviljk is probably the simplest, and hence a
  274. good place to start. Xdvik adds VF support and the complication of X
  275. resources. Dvipsk adds the complication of its own config files.
  276.  
  277.   Beyond these of examples of use, the `.h' files in the Kpathsea
  278. source describe the interfaces and functionality (and of course the
  279. `.c' files define the actual routines, which are the ultimate
  280. documentation).  `pathsearch.h' declares the basic searching routine.
  281. `tex-file.h' and `tex-glyph.h' define the interfaces for looking up
  282. particular kinds of files.
  283.  
  284.   The library provides no way for an external program to register new
  285. file types: `tex-file.[ch]' must be modified to do this. For example,
  286. Kpathsea has support for looking up Dvips config files, even though
  287. obviously no program other than Dvips will ever want to do so. I felt
  288. this was acceptable, since along with new file types should also come
  289. new defaults in `texmf.cnf' (and its descendant `paths.h'), since it's
  290. best for users if they can modify one configuration file for all kinds
  291. of paths.
  292.  
  293.   Kpathsea does not open any files or parse any formats itself. Its
  294. purpose is only to return filenames. The GNU font utilities source does
  295. contain libraries to read TFM, GF, and PK files.
  296.  
  297. 
  298. File: kpathsea.info,  Node: Calling sequence,  Next: Programming with config files,  Prev: Programming overview,  Up: Programming
  299.  
  300. Calling sequence
  301. ================
  302.  
  303.   The typical way to use Kpathsea in your program goes something like
  304. this:
  305.  
  306.   1. Call `kpse_set_progname' with `argv[0]'; This is the only
  307.      initialization that is mandatory to take full advantage of
  308.      Kpathsea--specifically, for the `.PROGRAM' feature of config files
  309.      (*note Config files::.).
  310.  
  311.      `kpse_set_progname' sets the global variables
  312.      `program_invocation_name' and `program_invocation_short_name'.  It
  313.      also initializes debugging flags based on the environment variable
  314.      `KPATHSEA_DEBUG', if that is set.  set.
  315.  
  316.      The GNU C library provides these two global variables itself; in
  317.      this case, the call to `kpse_set_program' does nothing. But you
  318.      (as a software author) most likely do not want to force people
  319.      installing your program to have glibc.
  320.  
  321.   2. Set debugging options. *Note Debugging::. If your program doesn't
  322.      have a debugging flag already, you can define one and set
  323.      `kpathsea_debug' to the number that the user supplies (see
  324.      Dviljk), or you can just omit this altogether (people can always
  325.      set `KPATHSEA_DEBUG').  If you do have runtime debugging already,
  326.      you need to merge Kpathsea's options with yours (see Dvipsk and
  327.      Xdvik).
  328.  
  329.   3. If your program has its own configuration files that can define
  330.      search paths, you should assign those paths to the `client_path'
  331.      member in the appropriate element of the `kpse_format_info' array.
  332.      (This array is indexed by file type; see `tex-file.h'.)  See
  333.      `resident.c' in Dvipsk for an example.
  334.  
  335.   4. Call `kpse_init_prog' (see `proginit.c'). It's useful for the DVI
  336.      drivers, at least, but for other programs it may be simpler to
  337.      extract the parts of it that actually apply.  This does not
  338.      initialize any paths, it just looks for (and sets) certain
  339.      environment variables and other random information.  (A search
  340.      path is always initialized at the first call to find a file of
  341.      that type; this eliminates much useless work, e.g., initializing
  342.      the BibTeX search paths in a DVI driver.)
  343.  
  344.   5. The routine to actually find a file of type FORMAT is
  345.      `kpse_find_FORMAT', defined in `tex-file.h'. These are macros that
  346.      expand to a call to `kpse_find_file'.  You can call, say,
  347.      `kpse_find_tfm' after doing only the first of the initialization
  348.      steps above--Kpathsea will read the generic config file
  349.      `texmf.cmf', look for environment variables, and do the expansions
  350.      at the first lookup.
  351.  
  352.   6. To find PK and/or GF bitmap fonts, the routines are `kpse_find_pk',
  353.      `kpse_find_gf' and `kpse_find_glyph', defined in `tex-glyph.h'.
  354.      These return a structure in addition to the resultant filename,
  355.      because fonts can be found in so many ways. See the documentation
  356.      in the source.
  357.  
  358.  
  359.   Kpathsea also provides many utility routines. Some are generic: hash
  360. tables, memory allocation, string concatenation and copying, string
  361. lists, reading input lines of unlimited length, etc. Others are
  362. filename-related: default path, tilde, and variable expansion, `stat'
  363. calls, etc. (Perhaps someday I'll move the former to a separate
  364. library.)
  365.  
  366.   The `c-*.h' header files can also help your program adapt to many
  367. different systems.  You will almost certainly want to use Autoconf for
  368. configuring your software if you use Kpathsea; I strongly recommend
  369. using Autoconf regardless.  You can get it by ftp from
  370. `prep.ai.mit.edu' in `pub/gnu/autoconf-*.tar.gz', or from any of its
  371. mirrors.
  372.  
  373. 
  374. File: kpathsea.info,  Node: Programming with config files,  Prev: Calling sequence,  Up: Programming
  375.  
  376. Programming with config files
  377. =============================
  378.  
  379.   You can use the same `texmf.cnf' configuration file as Kpathsea for
  380. your program. This will help installers do all configuration in one
  381. place.
  382.  
  383.   To retrieve a value VAR, the best way is to call `kpse_var_expand' on
  384. the string `$VAR'. This will look first for an environment variable
  385. VAR, then a config file value. The result will be the value found, or
  386. the empty string. This function is declared in `kpathsea/variable.h'.
  387.  
  388.   If for some reason you want to retrieve a value *only* from a config
  389. file, not automatically looking for a corresponding environment
  390. variable, call `kpse_cnf_get' (declared in `kpathsea/cnf.h') with the
  391. string VAR.
  392.  
  393.   No initialization calls are needed.
  394.  
  395. 
  396. File: kpathsea.info,  Node: Copying,  Next: Freedom,  Prev: Programming,  Up: Top
  397.  
  398. GNU GENERAL PUBLIC LICENSE
  399. **************************
  400.  
  401.                          Version 2, June 1991
  402.  
  403.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  404.      675 Mass Ave, Cambridge, MA 02139, USA
  405.      
  406.      Everyone is permitted to copy and distribute verbatim copies
  407.      of this license document, but changing it is not allowed.
  408.  
  409. Preamble
  410. ========
  411.  
  412.   The licenses for most software are designed to take away your freedom
  413. to share and change it.  By contrast, the GNU General Public License is
  414. intended to guarantee your freedom to share and change free
  415. software--to make sure the software is free for all its users.  This
  416. General Public License applies to most of the Free Software
  417. Foundation's software and to any other program whose authors commit to
  418. using it.  (Some other Free Software Foundation software is covered by
  419. the GNU Library General Public License instead.)  You can apply it to
  420. your programs, too.
  421.  
  422.   When we speak of free software, we are referring to freedom, not
  423. price.  Our General Public Licenses are designed to make sure that you
  424. have the freedom to distribute copies of free software (and charge for
  425. this service if you wish), that you receive source code or can get it
  426. if you want it, that you can change the software or use pieces of it in
  427. new free programs; and that you know you can do these things.
  428.  
  429.   To protect your rights, we need to make restrictions that forbid
  430. anyone to deny you these rights or to ask you to surrender the rights.
  431. These restrictions translate to certain responsibilities for you if you
  432. distribute copies of the software, or if you modify it.
  433.  
  434.   For example, if you distribute copies of such a program, whether
  435. gratis or for a fee, you must give the recipients all the rights that
  436. you have.  You must make sure that they, too, receive or can get the
  437. source code.  And you must show them these terms so they know their
  438. rights.
  439.  
  440.   We protect your rights with two steps: (1) copyright the software, and
  441. (2) offer you this license which gives you legal permission to copy,
  442. distribute and/or modify the software.
  443.  
  444.   Also, for each author's protection and ours, we want to make certain
  445. that everyone understands that there is no warranty for this free
  446. software.  If the software is modified by someone else and passed on, we
  447. want its recipients to know that what they have is not the original, so
  448. that any problems introduced by others will not reflect on the original
  449. authors' reputations.
  450.  
  451.   Finally, any free program is threatened constantly by software
  452. patents.  We wish to avoid the danger that redistributors of a free
  453. program will individually obtain patent licenses, in effect making the
  454. program proprietary.  To prevent this, we have made it clear that any
  455. patent must be licensed for everyone's free use or not licensed at all.
  456.  
  457.   The precise terms and conditions for copying, distribution and
  458. modification follow.
  459.  
  460.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  461.  
  462.   1. This License applies to any program or other work which contains a
  463.      notice placed by the copyright holder saying it may be distributed
  464.      under the terms of this General Public License.  The "Program",
  465.      below, refers to any such program or work, and a "work based on
  466.      the Program" means either the Program or any derivative work under
  467.      copyright law: that is to say, a work containing the Program or a
  468.      portion of it, either verbatim or with modifications and/or
  469.      translated into another language.  (Hereinafter, translation is
  470.      included without limitation in the term "modification".)  Each
  471.      licensee is addressed as "you".
  472.  
  473.      Activities other than copying, distribution and modification are
  474.      not covered by this License; they are outside its scope.  The act
  475.      of running the Program is not restricted, and the output from the
  476.      Program is covered only if its contents constitute a work based on
  477.      the Program (independent of having been made by running the
  478.      Program).  Whether that is true depends on what the Program does.
  479.  
  480.   2. You may copy and distribute verbatim copies of the Program's
  481.      source code as you receive it, in any medium, provided that you
  482.      conspicuously and appropriately publish on each copy an appropriate
  483.      copyright notice and disclaimer of warranty; keep intact all the
  484.      notices that refer to this License and to the absence of any
  485.      warranty; and give any other recipients of the Program a copy of
  486.      this License along with the Program.
  487.  
  488.      You may charge a fee for the physical act of transferring a copy,
  489.      and you may at your option offer warranty protection in exchange
  490.      for a fee.
  491.  
  492.   3. You may modify your copy or copies of the Program or any portion
  493.      of it, thus forming a work based on the Program, and copy and
  494.      distribute such modifications or work under the terms of Section 1
  495.      above, provided that you also meet all of these conditions:
  496.  
  497.        a. You must cause the modified files to carry prominent notices
  498.           stating that you changed the files and the date of any change.
  499.  
  500.        b. You must cause any work that you distribute or publish, that
  501.           in whole or in part contains or is derived from the Program
  502.           or any part thereof, to be licensed as a whole at no charge
  503.           to all third parties under the terms of this License.
  504.  
  505.        c. If the modified program normally reads commands interactively
  506.           when run, you must cause it, when started running for such
  507.           interactive use in the most ordinary way, to print or display
  508.           an announcement including an appropriate copyright notice and
  509.           a notice that there is no warranty (or else, saying that you
  510.           provide a warranty) and that users may redistribute the
  511.           program under these conditions, and telling the user how to
  512.           view a copy of this License.  (Exception: if the Program
  513.           itself is interactive but does not normally print such an
  514.           announcement, your work based on the Program is not required
  515.           to print an announcement.)
  516.  
  517.      These requirements apply to the modified work as a whole.  If
  518.      identifiable sections of that work are not derived from the
  519.      Program, and can be reasonably considered independent and separate
  520.      works in themselves, then this License, and its terms, do not
  521.      apply to those sections when you distribute them as separate
  522.      works.  But when you distribute the same sections as part of a
  523.      whole which is a work based on the Program, the distribution of
  524.      the whole must be on the terms of this License, whose permissions
  525.      for other licensees extend to the entire whole, and thus to each
  526.      and every part regardless of who wrote it.
  527.  
  528.      Thus, it is not the intent of this section to claim rights or
  529.      contest your rights to work written entirely by you; rather, the
  530.      intent is to exercise the right to control the distribution of
  531.      derivative or collective works based on the Program.
  532.  
  533.      In addition, mere aggregation of another work not based on the
  534.      Program with the Program (or with a work based on the Program) on
  535.      a volume of a storage or distribution medium does not bring the
  536.      other work under the scope of this License.
  537.  
  538.   4. You may copy and distribute the Program (or a work based on it,
  539.      under Section 2) in object code or executable form under the terms
  540.      of Sections 1 and 2 above provided that you also do one of the
  541.      following:
  542.  
  543.        a. Accompany it with the complete corresponding machine-readable
  544.           source code, which must be distributed under the terms of
  545.           Sections 1 and 2 above on a medium customarily used for
  546.           software interchange; or,
  547.  
  548.        b. Accompany it with a written offer, valid for at least three
  549.           years, to give any third party, for a charge no more than your
  550.           cost of physically performing source distribution, a complete
  551.           machine-readable copy of the corresponding source code, to be
  552.           distributed under the terms of Sections 1 and 2 above on a
  553.           medium customarily used for software interchange; or,
  554.  
  555.        c. Accompany it with the information you received as to the offer
  556.           to distribute corresponding source code.  (This alternative is
  557.           allowed only for noncommercial distribution and only if you
  558.           received the program in object code or executable form with
  559.           such an offer, in accord with Subsection b above.)
  560.  
  561.      The source code for a work means the preferred form of the work for
  562.      making modifications to it.  For an executable work, complete
  563.      source code means all the source code for all modules it contains,
  564.      plus any associated interface definition files, plus the scripts
  565.      used to control compilation and installation of the executable.
  566.      However, as a special exception, the source code distributed need
  567.      not include anything that is normally distributed (in either
  568.      source or binary form) with the major components (compiler,
  569.      kernel, and so on) of the operating system on which the executable
  570.      runs, unless that component itself accompanies the executable.
  571.  
  572.      If distribution of executable or object code is made by offering
  573.      access to copy from a designated place, then offering equivalent
  574.      access to copy the source code from the same place counts as
  575.      distribution of the source code, even though third parties are not
  576.      compelled to copy the source along with the object code.
  577.  
  578.   5. You may not copy, modify, sublicense, or distribute the Program
  579.      except as expressly provided under this License.  Any attempt
  580.      otherwise to copy, modify, sublicense or distribute the Program is
  581.      void, and will automatically terminate your rights under this
  582.      License.  However, parties who have received copies, or rights,
  583.      from you under this License will not have their licenses
  584.      terminated so long as such parties remain in full compliance.
  585.  
  586.   6. You are not required to accept this License, since you have not
  587.      signed it.  However, nothing else grants you permission to modify
  588.      or distribute the Program or its derivative works.  These actions
  589.      are prohibited by law if you do not accept this License.
  590.      Therefore, by modifying or distributing the Program (or any work
  591.      based on the Program), you indicate your acceptance of this
  592.      License to do so, and all its terms and conditions for copying,
  593.      distributing or modifying the Program or works based on it.
  594.  
  595.   7. Each time you redistribute the Program (or any work based on the
  596.      Program), the recipient automatically receives a license from the
  597.      original licensor to copy, distribute or modify the Program
  598.      subject to these terms and conditions.  You may not impose any
  599.      further restrictions on the recipients' exercise of the rights
  600.      granted herein.  You are not responsible for enforcing compliance
  601.      by third parties to this License.
  602.  
  603.   8. If, as a consequence of a court judgment or allegation of patent
  604.      infringement or for any other reason (not limited to patent
  605.      issues), conditions are imposed on you (whether by court order,
  606.      agreement or otherwise) that contradict the conditions of this
  607.      License, they do not excuse you from the conditions of this
  608.      License.  If you cannot distribute so as to satisfy simultaneously
  609.      your obligations under this License and any other pertinent
  610.      obligations, then as a consequence you may not distribute the
  611.      Program at all.  For example, if a patent license would not permit
  612.      royalty-free redistribution of the Program by all those who
  613.      receive copies directly or indirectly through you, then the only
  614.      way you could satisfy both it and this License would be to refrain
  615.      entirely from distribution of the Program.
  616.  
  617.      If any portion of this section is held invalid or unenforceable
  618.      under any particular circumstance, the balance of the section is
  619.      intended to apply and the section as a whole is intended to apply
  620.      in other circumstances.
  621.  
  622.      It is not the purpose of this section to induce you to infringe any
  623.      patents or other property right claims or to contest validity of
  624.      any such claims; this section has the sole purpose of protecting
  625.      the integrity of the free software distribution system, which is
  626.      implemented by public license practices.  Many people have made
  627.      generous contributions to the wide range of software distributed
  628.      through that system in reliance on consistent application of that
  629.      system; it is up to the author/donor to decide if he or she is
  630.      willing to distribute software through any other system and a
  631.      licensee cannot impose that choice.
  632.  
  633.      This section is intended to make thoroughly clear what is believed
  634.      to be a consequence of the rest of this License.
  635.  
  636.   9. If the distribution and/or use of the Program is restricted in
  637.      certain countries either by patents or by copyrighted interfaces,
  638.      the original copyright holder who places the Program under this
  639.      License may add an explicit geographical distribution limitation
  640.      excluding those countries, so that distribution is permitted only
  641.      in or among countries not thus excluded.  In such case, this
  642.      License incorporates the limitation as if written in the body of
  643.      this License.
  644.  
  645.  10. The Free Software Foundation may publish revised and/or new
  646.      versions of the General Public License from time to time.  Such
  647.      new versions will be similar in spirit to the present version, but
  648.      may differ in detail to address new problems or concerns.
  649.  
  650.      Each version is given a distinguishing version number.  If the
  651.      Program specifies a version number of this License which applies
  652.      to it and "any later version", you have the option of following
  653.      the terms and conditions either of that version or of any later
  654.      version published by the Free Software Foundation.  If the Program
  655.      does not specify a version number of this License, you may choose
  656.      any version ever published by the Free Software Foundation.
  657.  
  658.  11. If you wish to incorporate parts of the Program into other free
  659.      programs whose distribution conditions are different, write to the
  660.      author to ask for permission.  For software which is copyrighted
  661.      by the Free Software Foundation, write to the Free Software
  662.      Foundation; we sometimes make exceptions for this.  Our decision
  663.      will be guided by the two goals of preserving the free status of
  664.      all derivatives of our free software and of promoting the sharing
  665.      and reuse of software generally.
  666.  
  667.                                 NO WARRANTY
  668.  
  669.  12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  670.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  671.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  672.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  673.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  674.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  675.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  676.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  677.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  678.      SERVICING, REPAIR OR CORRECTION.
  679.  
  680.  13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  681.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  682.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  683.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  684.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  685.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  686.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  687.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  688.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  689.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  690.  
  691.                       END OF TERMS AND CONDITIONS
  692.  
  693. Appendix: How to Apply These Terms to Your New Programs
  694. =======================================================
  695.  
  696.   If you develop a new program, and you want it to be of the greatest
  697. possible use to the public, the best way to achieve this is to make it
  698. free software which everyone can redistribute and change under these
  699. terms.
  700.  
  701.   To do so, attach the following notices to the program.  It is safest
  702. to attach them to the start of each source file to most effectively
  703. convey the exclusion of warranty; and each file should have at least
  704. the "copyright" line and a pointer to where the full notice is found.
  705.  
  706.      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  707.      Copyright (C) 19YY  NAME OF AUTHOR
  708.      
  709.      This program is free software; you can redistribute it and/or modify
  710.      it under the terms of the GNU General Public License as published by
  711.      the Free Software Foundation; either version 2 of the License, or
  712.      (at your option) any later version.
  713.      
  714.      This program is distributed in the hope that it will be useful,
  715.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  716.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  717.      GNU General Public License for more details.
  718.      
  719.      You should have received a copy of the GNU General Public License
  720.      along with this program; if not, write to the Free Software
  721.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  722.  
  723.   Also add information on how to contact you by electronic and paper
  724. mail.
  725.  
  726.   If the program is interactive, make it output a short notice like this
  727. when it starts in an interactive mode:
  728.  
  729.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  730.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  731.      This is free software, and you are welcome to redistribute it
  732.      under certain conditions; type `show c' for details.
  733.  
  734.   The hypothetical commands `show w' and `show c' should show the
  735. appropriate parts of the General Public License.  Of course, the
  736. commands you use may be called something other than `show w' and `show
  737. c'; they could even be mouse-clicks or menu items--whatever suits your
  738. program.
  739.  
  740.   You should also get your employer (if you work as a programmer) or
  741. your school, if any, to sign a "copyright disclaimer" for the program,
  742. if necessary.  Here is a sample; alter the names:
  743.  
  744.      Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  745.      `Gnomovision' (which makes passes at compilers) written by James Hacker.
  746.      
  747.      SIGNATURE OF TY COON, 1 April 1989
  748.      Ty Coon, President of Vice
  749.  
  750.   This General Public License does not permit incorporating your
  751. program into proprietary programs.  If your program is a subroutine
  752. library, you may consider it more useful to permit linking proprietary
  753. applications with the library.  If this is what you want to do, use the
  754. GNU Library General Public License instead of this License.
  755.  
  756. 
  757. File: kpathsea.info,  Node: Freedom,  Next: Index,  Prev: Copying,  Up: Top
  758.  
  759. Regain your programming freedom
  760. *******************************
  761.  
  762.   Until a few years ago, programmers in the United States could write
  763. any program they wished.  This freedom has now been taken away by two
  764. developments: software patents, which grant the patent holder an
  765. absolute monopoly on some programming technique, and user interface
  766. copyright, which forbid compatible implementations of an existing user
  767. interface.
  768.  
  769.   In Europe, especially through the GATT treaty, things are rapidly
  770. approaching the same pass.
  771.  
  772. * Menu:
  773.  
  774. * Software patents::            Algorithm monopolies.
  775. * User interface copyright::    Forbidding upward-compatibility.
  776. * What to do?::                 What to do?
  777.  
  778. 
  779. File: kpathsea.info,  Node: Software patents,  Next: User interface copyright,  Up: Freedom
  780.  
  781. Software patents
  782. ================
  783.  
  784.   The U.S. Patent and Trademark Office has granted numerous software
  785. patents on software techniques.  Patents are an absolute
  786. monopoly--independent reinvention is precluded.  This monopoly lasts
  787. for seventeen years, i.e., forever (with respect to computer science).
  788.  
  789.   One patent relevant to TeX is patent 4,956,809, issued to the Mark
  790. Williams company on September 11, 1990, applied for in 1982, which
  791. covers (among other things)
  792.      representing in a standardized order consisting of a standard
  793.      binary structure file stored on auxiliary memory or transported on
  794.      a communications means, said standardized order being different
  795.      from a different order used on at least one of the different
  796.      computers;
  797.  
  798.      Converting in each of the different computers binary data read
  799.      from an auxiliary data storage or communications means from the
  800.      standardized order to the natural order of the respective host
  801.      computer after said binary data are read from said auxiliary data
  802.      storage or communications means and before said binary data are
  803.      used by the respective host computer; and
  804.  
  805.      Converting in each of the different computers binary data written
  806.      into auxiliary data storage or communications means from the
  807.      natural order of the respective host computer to the standardized
  808.      order prior to said writing.
  809.  
  810. ... in other words, storing data on disk in a machine-independent
  811. order, as the DVI, TFM, GF, and PK file formats specify.  Even though
  812. TeX is "prior art" in this respect, the patent was granted (the patent
  813. examiners not being computer scientists, even less computer
  814. typographers).  Since there is a strong presumption in the courts of a
  815. patent's validity once it has been granted, there is a good chance that
  816. users or implementors of TeX could be successfully sued on the issue.
  817.  
  818.   As another example, the X window system, which was intended to be able
  819. to be used freely by everyone, is now being threatened by two patents:
  820. 4,197,590 on the use of exclusive-or to redraw cursors, held by Cadtrak,
  821. a litigation company (this has been upheld twice in court); and
  822. 4,555,775, held by AT&T, on the use of backing store to redraw windows
  823. quickly.
  824.  
  825.   Here is one excerpt from a recent mailing by the League for
  826. Programming Freedom (*note What to do?::.) which I feel sums up the
  827. situation rather well.  It comes from an article in `Think' magazine,
  828. issue #5, 1990.  The comments after the quote were written by Richard
  829. Stallman.
  830.  
  831.          "You get value from patents in two ways," says Roger Smith, IBM
  832.         Assistant General Counsel, intellectual property law.
  833.      "Through fees,     and through licensing negotiations that give
  834.      IBM access to other     patents.
  835.  
  836.      "The IBM patent portfolio gains us the freedom to do what we need
  837.      to     do through cross-licensing--it gives us access to the
  838.      inventions of     others that are the key to rapid innovation.
  839.      Access is far more     valuable to IBM than the fees it receives
  840.      from its 9,000 active     patents.  There's no direct calculation
  841.      of this value, but it's many     times larger than the fee income,
  842.      perhaps an order of magnitude     larger."
  843.  
  844.   This information should dispel the belief that the patent system will
  845. "protect" a small software developer from competition from IBM.  IBM
  846. can always find patents in its collection which the small developer is
  847. infringing, and thus obtain a cross-license.
  848.  
  849.   However, the patent system does cause trouble for the smaller
  850. companies which, like IBM, need access to patented techniques in order
  851. to do useful work in software.  Unlike IBM, the smaller companies do
  852. not have 9,000 patents and cannot usually get a cross-license.  No
  853. matter how hard they try, they cannot have enough patents to do this.
  854.  
  855.   Only the elimination of patents from the software field can enable
  856. most software developers to continue with their work.
  857.  
  858.   The value IBM gets from cross-licensing is a measure of the amount of
  859. harm that the patent system would do to IBM if IBM could not avoid it.
  860. IBM's estimate is that the trouble could easily be ten times the good
  861. one can expect from one's own patents--even for a company with 9,000 of
  862. them.
  863.  
  864. 
  865. File: kpathsea.info,  Node: User interface copyright,  Next: What to do?,  Prev: Software patents,  Up: Freedom
  866.  
  867. User interface copyright
  868. ========================
  869.  
  870.   (This section is copied from the GCC manual, by Richard Stallman.)
  871.  
  872.      This section is a political message from the League for Programming
  873.      Freedom to the users of the GNU font utilities.  It is included
  874.      here as an expression of support for the League on my part.
  875.  
  876.   Apple, Lotus and Xerox are trying to create a new form of legal
  877. monopoly: a copyright on a class of user interfaces.  These monopolies
  878. would cause serious problems for users and developers of computer
  879. software and systems.
  880.  
  881.   Until a few years ago, the law seemed clear: no one could restrict
  882. others from using a user interface; programmers were free to implement
  883. any interface they chose.  Imitating interfaces, sometimes with changes,
  884. was standard practice in the computer field.  The interfaces we know
  885. evolved gradually in this way; for example, the Macintosh user interface
  886. drew ideas from the Xerox interface, which in turn drew on work done at
  887. Stanford and SRI.  1-2-3 imitated VisiCalc, and dBase imitated a
  888. database program from JPL.
  889.  
  890.   Most computer companies, and nearly all computer users, were happy
  891. with this state of affairs.  The companies that are suing say it does
  892. not offer "enough incentive" to develop their products, but they must
  893. have considered it "enough" when they made their decision to do so.  It
  894. seems they are not satisfied with the opportunity to continue to compete
  895. in the marketplace--not even with a head start.
  896.  
  897.   If Xerox, Lotus, and Apple are permitted to make law through the
  898. courts, the precedent will hobble the software industry:
  899.  
  900.    * Gratuitous incompatibilities will burden users.  Imagine if each
  901.      car manufacturer had to arrange the pedals in a different order.
  902.  
  903.    * Software will become and remain more expensive.  Users will be
  904.      "locked in" to proprietary interfaces, for which there is no real
  905.      competition.
  906.  
  907.    * Large companies have an unfair advantage wherever lawsuits become
  908.      commonplace.  Since they can easily afford to sue, they can
  909.      intimidate small companies with threats even when they don't
  910.      really have a case.
  911.  
  912.    * User interface improvements will come slower, since incremental
  913.      evolution through creative imitation will no longer be permitted.
  914.  
  915.    * Even Apple, etc., will find it harder to make improvements if they
  916.      can no longer adapt the good ideas that others introduce, for fear
  917.      of weakening their own legal positions.  Some users suggest that
  918.      this stagnation may already have started.
  919.  
  920.    * If you use GNU software, you might find it of some concern that
  921.      user interface copyright will make it hard for the Free Software
  922.      Foundation to develop programs compatible with the interfaces that
  923.      you already know.
  924.  
  925. 
  926. File: kpathsea.info,  Node: What to do?,  Prev: User interface copyright,  Up: Freedom
  927.  
  928. What to do?
  929. ===========
  930.  
  931.   (This section is copied from the GCC manual, by Richard Stallman.)
  932.  
  933.   To protect our freedom from lawsuits like these, a group of
  934. programmers and users have formed a new grass-roots political
  935. organization, the League for Programming Freedom.
  936.  
  937.   The purpose of the League is to oppose new monopolistic practices such
  938. as user-interface copyright and software patents; it calls for a return
  939. to the legal policies of the recent past, in which these practices were
  940. not allowed.  The League is not concerned with free software as an
  941. issue, and not affiliated with the Free Software Foundation.
  942.  
  943.   The League's membership rolls include John McCarthy, inventor of Lisp,
  944. Marvin Minsky, founder of the Artificial Intelligence lab, Guy L.
  945. Steele, Jr., author of well-known books on Lisp and C, as well as
  946. Richard Stallman, the developer of GNU CC.  Please join and add your
  947. name to the list.  Membership dues in the League are $42 per year for
  948. programmers, managers and professionals; $10.50 for students; $21 for
  949. others.
  950.  
  951.   The League needs both activist members and members who only pay their
  952. dues.
  953.  
  954.   To join, or for more information, phone (617) 492-0023 or write to:
  955.  
  956.      League for Programming Freedom
  957.      1 Kendall Square #143
  958.      P.O. Box 9171
  959.      Cambridge, MA 02139
  960.  
  961.   You can also send electronic mail to `league@prep.ai.mit.edu'.
  962.  
  963.   Here are some suggestions from the League for things you can do to
  964. protect your freedom to write programs:
  965.  
  966.    * Don't buy from Xerox, Lotus or Apple.  Buy from their competitors
  967.      or from the defendants they are suing.
  968.  
  969.    * Don't develop software to work with the systems made by these
  970.      companies.
  971.  
  972.    * Port your existing software to competing systems, so that you
  973.      encourage users to switch.
  974.  
  975.    * Write letters to company presidents to let them know their conduct
  976.      is unacceptable.
  977.  
  978.    * Tell your friends and colleagues about this issue and how it
  979.      threatens to ruin the computer industry.
  980.  
  981.    * Above all, don't work for the look-and-feel plaintiffs, and don't
  982.      accept contracts from them.
  983.  
  984.    * Write to Congress to explain the importance of this issue.
  985.  
  986.           House Subcommittee on Intellectual Property
  987.           2137 Rayburn Bldg
  988.           Washington, DC 20515
  989.           
  990.           Senate Subcommittee on Patents, Trademarks and Copyrights
  991.           United States Senate
  992.           Washington, DC 20510
  993.  
  994.      (These committees have received lots of mail already; let's give
  995.      them even more.)
  996.  
  997.   Express your opinion!  You can make a difference.
  998.  
  999.