shared font directory

Daniel Quinlan quinlan@transmeta.com
Sat, 2 Oct 1999 02:00:36 -0700


Hello.

I'm working on a proposed addition to the Filesystem Hierarchy Standard
(FHS) describing a shared font directory that can be used by multiple
applications, possibly including TeX.  I'd like to get your feedback.
(I'm also contacting L. Peter Deutsch and a few other people, but I'd
like to run this through a revision or two before placing too many
people on the Cc list.)

By the way, FHS web site is <URL:http://www.pathname.com/fhs/>.

One problem on most existing Unix systems is that fonts are stored
separately by each application.  The drawbacks of this are:

 - Applications don't have easy access to every available and useful
   font (this is even more important for fonts you purchased, like
   TrueType fonts that come with Windows 95).

 - Some fonts may be installed more than once on a system.

The obvious problem faced when creating a single hierarchy for fonts is
that almost every existing application does things differently.
Extensive modifications to numerous applications would be necessary.

I think this proposal (the idea is from H. Peter Anvin) addresses that
problem.  It also attempts to work with existing font directory
structures such as the ones used TeX and Ghostscript.  Note, however,
that this proposal doesn't necessarily require *any* changes to existing
applications.

------------------------------------------------------------------------

/usr/share/fonts : directory for architecture-independent shared fonts

This directory is where font data should be stored, provided the font
data is:

  * architecture-independent
  * application-independent
  * usable by multiple applications, well-defined, etc.
  * not variable or transient

No files should be stored directly in /usr/share/fonts.  Top-level
subdirectories of /usr/share/fonts shall be named <font> where <font> is
the name of the font type.

Reserved type names include:

  * type1 - PostScript Type 1 fonts
  * psf   - PSF fonts
  * snf   - SNF fonts
  * ttf   - TrueType fonts
  * pk    - packed bitmap files

(This list should be expanded.)

The directory structure and naming system used under each <type>
hierarchy should be organized according to whatever standard exists for
organizing that particular font type.  For example, PostScript Type1
font files are usually stored directly under the type1 directory.  (When
possible and it makes sense to do so, we should try to specify the
sub-structure within the FHS.)

BEGIN_RATIONALE

This directory is intended to eliminate unnecessary duplication of fonts
on the system.  It will also help make more fonts available to each
application.

END_RATIONALE

/usr/lib/font-install : application-specific routines for font installation

This directory shall contain application-specific shell scripts to be
executed when fonts are installed and removed.  Shell scripts shall be
named according to the following convention:

   <application name>-install : post-installation scripts
   <application name>-delete  : post-deletion scripts

Whenever fonts are installed into /usr/share/fonts, each
post-installation script shall be executed.  Likewise, whenever fonts
are removed from /usr/share/fonts, each post-deletion script shall be
executed.

No arguments or input for these scripts are defined at this time.  All
arguments and input to these scripts are reserved for future use.  (I
plan to include arguments or input so scripts can be told which fonts or
at least font-types have been modified so less work may be required by
application font installers.)

BEGIN_RATIONALE

This directory is primarily intended to be a transition measure so
applications can easily be made to use the new shared font structure.
However, it is expected that /usr/lib/font-install will exist in one
form or another for some time.

END_RATIONALE

/usr/lib/fonts : directory for architecture-specific shared fonts

This shall be used in the same manner as /usr/share/fonts save that
architecture-specific fonts shall be stored here.  Architecture-specific
fonts must not go into /usr/share/fonts.  However, fonts that are only
optimized for a specific architecture or byte-order may be placed in
/usr/share/fonts if the fonts will work on any architecture or
byte-order.

Compliant font libraries should search /usr/lib/fonts and
/usr/share/fonts for fonts.  The search order is not specified.

BEGIN_RATIONALE

Some font systems perform better with native formatted copies of a font
so it is desirable to allow those systems to use /usr/lib/fonts first.
Other font systems see no benefit and those systems benefit from using
/usr/share/fonts first so the same precise fonts are used as other
machines on a network.

------------------------------------------------------------------------