LinuxCommandLibrary

addftinfo

Add font information for use by groff

SYNOPSIS

addftinfo [options] ...

PARAMETERS

-h
    Displays a short usage message and exits.

-V
    Prints the version information of addftinfo and exits.

-v
    Enables verbose output, showing more details about the processing.

-f
    Attempts to fix broken BDF font files, for example, those missing the ENDFONT keyword.

-a
    Adds encoding adobe to the font information if it's not already present.

-i
    Prevents addftinfo from adding information if it detects that font info is already present in the file.

-e <encoding>
    Forces the specified encoding string to be used instead of attempting to guess the encoding.

-s <fontfamily>
    Forces the specified fontfamily string to be used instead of guessing the font's family.

-F
    Instructs the command to add the FOUNDRY field to the font information (this is disabled by default).

-k
    Prevents the addition of a PFB (Printer Font Binary) header to Type 1 fonts. This option can be useful if addftinfo incorrectly adds a PFB header to a PFA (Printer Font ASCII) font.

DESCRIPTION

addftinfo is a utility program provided as part of the FreeType library's demonstration or utility packages. Its primary function is to parse various font files, such as Type 1 (PFA/PFB) and BDF fonts, and embed additional metadata into them. This metadata, including details like FONT, FAMILY, WEIGHT, FOUNDRY, and ENCODING, is crucial for font configuration systems like Fontconfig to correctly identify and use the fonts.

The command inserts this information as a comment block within the font file: typically after EndFontMetrics for Type 1 fonts or before EndSplineFont for BDF fonts. While TrueType fonts usually contain sufficient internal metadata, addftinfo can also extract information from them. It works by creating a temporary modified file and then replacing the original, ensuring atomic updates. This tool is especially useful for older or less compliant font files that might lack the necessary metadata for modern font systems to function optimally.

CAVEATS

  • Primarily useful for older or non-standard Type 1 and BDF fonts. Modern font formats like TrueType and OpenType typically embed sufficient metadata and do not require addftinfo.
  • The command modifies the font file directly by creating a temporary file and then renaming it. It's always advisable to back up critical font files before processing them.
  • Incorrect usage or issues with the source font file can potentially lead to corrupted font files, though the temporary file approach reduces risk.

PURPOSE IN FONT MANAGEMENT

While font rendering is handled by libraries like FreeType, font discovery and selection are managed by systems like Fontconfig. Fontconfig relies on specific metadata embedded within font files or provided in configuration files. addftinfo bridges the gap for fonts that lack this necessary internal metadata, making them discoverable and usable by Fontconfig without manual configuration.

SUPPORTED FONT FORMATS

The tool primarily targets Type 1 (both PFA and PFB) and BDF (Glyph Bitmap Distribution Format) font files. While it can extract information from TrueType fonts, it generally does not need to add information to them as TrueType fonts typically have rich internal metadata.

HISTORY

addftinfo is part of the FreeType project, a widely used software library that implements a font rasterizer. It was developed by David Turner and has been a component of the FreeType utility suite for a considerable time, serving to address the specific need of embedding metadata into older or less compliant font formats to ensure proper recognition and rendering by modern font rendering systems like Fontconfig. Its primary utility emerged from the necessity to standardize font metadata across various formats for consistent font discovery and management in Unix-like operating systems.

SEE ALSO

ftdump(1), fc-cache(1), fc-match(1), freetype(3)

Copied to clipboard