LinuxCommandLibrary

tfmtodit

Convert troff fonts to ditroff font files

SYNOPSIS

tfmtodit [-a append] [-c checksum] [-e encoding] [-f factor] [-h] [-i index] [-v] tfmfile ditfile

PARAMETERS

tfmfile
    The input TeX font metric file (.tfm) to be converted. This file contains the font's dimensional data.

ditfile
    The output groff font description file (.dit) where the converted font information will be written.

-a append
    Specifies the name of a file whose contents will be appended to the end of the generated ditfile. This is useful for adding supplementary data like ligatures or kerning information.

-c checksum
    Allows you to specify a checksum value to be embedded in the output font file. If omitted, the checksum from the input tfmfile is used.

-e encoding
    Designates an encoding file. This file contains mappings from character codes in the .tfm file to standard glyph names, which is crucial for correct character rendering, especially for non-ASCII or special characters.

-f factor
    Defines a scaling factor. All font dimensions read from the .tfm file will be multiplied by this factor. The default value is 1000. This is useful for adjusting internal font units.

-h
    Displays a help message detailing command usage and options, then exits.

-i index
    Sets the internal index of the first character in the font. The default value is 0.

-v
    Enables verbose output. This option causes tfmtodit to print additional information about the conversion process to standard error.

DESCRIPTION

tfmtodit is a utility program that serves as a bridge between the TeX typesetting system and the groff (GNU troff) document formatting system. Its primary function is to transform TeX font metric (.tfm) files, which encapsulate detailed information about the dimensions and characteristics of TeX fonts, into groff font description (.dit) files.

These .dit files are indispensable for groff to accurately render and use TeX fonts when generating output, particularly for device-independent formats like PostScript. By performing this conversion, tfmtodit enables users to leverage the extensive collection of high-quality TeX fonts within the groff environment, thereby expanding groff's typographic capabilities. It is commonly utilized by system administrators or advanced users who need to customize their groff setup to include specific TeX fonts not natively supported.

CAVEATS

tfmtodit is designed for standard TeX font metrics and might not fully support highly complex or newer font features (e.g., certain OpenType or TrueType capabilities) that go beyond the scope of traditional .tfm files.

The correct functioning of character mapping heavily relies on the provision of an accurate encoding file via the -e option; without it, character display issues may arise, especially for non-English or symbolic fonts. The input tfmfile must be a valid and uncorrupted TeX font metric file for successful conversion.

For groff to locate and use the generated ditfile, it typically needs to be placed in a directory configured in GROFF_FONT_PATH or standard groff font directories (e.g., /usr/share/groff/site-font/dev<device>/).

HISTORY

tfmtodit is an integral component of the groff (GNU troff) distribution, a free and powerful implementation of the classic Unix troff document formatter. Its development traces back to the late 1980s with the inception of groff by James Clark. The command was created to address the need for groff to utilize fonts specifically designed for the TeX typesetting system, a critical capability given TeX's prominence in academic and technical publishing.

By enabling the conversion of TeX's binary .tfm format into groff's text-based font description format, tfmtodit significantly expanded groff's typographic palette, allowing users to seamlessly integrate the vast library of high-quality TeX fonts into their groff-formatted documents and facilitating interoperability between these two distinct yet powerful typesetting ecosystems.

SEE ALSO

groff(1), dvips(1), grops(1), tex(1), mf(1)

Copied to clipboard