next up previous contents
Next: Font file loading information Up: Font installation Previous: Font definition files

Font definition file commands

The .fd files should contain only commands from this section. Note that those commands can also be used outside a .fd file: they can be put in package or class files, or even in the preamble of a document.


\ProvidesFile{<file-name>}[<release-info>]

The .fd file should announce itself with a \ProvidesFile command, as described in LaTeX2e for Class and Package Writers. For example:

   \ProvidesFile{t1ptm.fd}[1994/06/01 Adobe Times font definitions]


\DeclareFontFamily {<encoding>} {<family>} {<loading-settings>}

Declares a font family <family> to be available in encoding scheme <encoding>.

The <loading-settings> are executed immediately after loading any font with this encoding and family.

Checks that <encoding> was previously declared.

This example refers to the Computer Modern Typewriter font family in the Cork encoding:

   \DeclareFontFamily{T1}{cmtt}{\hyphenchar\font=-1}

Each .fd file should contain exactly one \DeclareFontFamily command, and it should be for the appropriate encoding/family combination.


\DeclareFontShape {<encoding>} {<family>} {<series>} {<shape>}
{<loading-info>} {<loading-settings>}

Declares a font shape combination; here <loading-info> contains the information that combines sizes with external fonts. The syntax is complex and is described in Section 4.3 below.

The <loading-settings> are executed after loading any font with this font shape. They are executed immediately after the `loading-settings' which were declared by \DeclareFontFamily and so they can be used to overwrite the settings made at the family level.

Checks that the combination <encoding><family> was previously declared via \DeclareFontFamily.

Example:

   \DeclareFontShape{OT1}{cmr}{m}{sl}{%
             <<5-8>> sub * cmr/m/n
             <<8>> cmsl8
             <<9>> cmsl9
             <<10>> <<10.95>> cmsl10
             <<12>> <<14.4>> <<17.28>> <<20.74>> <<24.88>> cmsl12
             }{}
An .fd file can contain any number of \DeclareFontShape commands, which should be for the appropriate <encoding> and <family>.

The font family declarations for the OT1-encoded fonts now all contain:

  \hyphenchar\font=`\-
This enables the use of an alternative \hyphenchar in other encodings whilst maintaining the correct value for all fonts.



Rainer Schoepf
Thu Jul 31 16:42:26 MEST 1997