LinuxCommandLibrary

mkfontscale

Create scalable font index files

SYNOPSIS

mkfontscale [-a alias-file] [-b] [-c] [-e encoding-name] [-f] [-l] [-o output-file] [-p prefix] [-s] [-t] [-u] [-v] [-x directory] [directory...]

PARAMETERS

-a alias-file
    Appends aliases from the specified alias-file to the generated fonts.scale file.

-b
    Excludes bitmap fonts from the generated output. Only scalable fonts will be listed.

-c
    Excludes scalable fonts from the generated output. Only bitmap fonts will be listed.

-e encoding-name
    Adds the specified encoding-name to the list of encodings supported by fonts in the output.

-f
    Forces a complete scan of directories, even if fonts.dir or fonts.scale files already exist.

-l
    Prevents scanning of subdirectories. By default, mkfontscale scans recursively.

-o output-file
    Specifies the name of the output file instead of the default fonts.scale.

-p prefix
    Adds a prefix to the font names listed in the fonts.scale file.

-s
    Do not write fonts.dir information. Only the fonts.scale file will be generated.

-t
    Do not sort the output. This can be useful for comparing changes between runs.

-u
    Updates an existing fonts.scale file by adding new entries, without removing old ones.

-v
    Enables verbose output, providing more information about the scanning process.

-x directory
    Excludes the specified directory from being scanned.

directory...
    One or more directories to scan for font files. If not specified, the current directory is scanned.

DESCRIPTION

mkfontscale is a utility used in the X Window System to generate font scaling information. It scans a specified directory (and optionally its subdirectories) for font files, such as TrueType (.ttf) or Type 1 (.pfa, .pfb) fonts.

The primary output is a file named fonts.scale, which contains a list of font names, aliases, and their associated metrics. This file is crucial for the X server to correctly identify and scale available fonts. It allows the server to determine which font files provide scalable fonts and how they should be rendered at different sizes.

This utility complements mkfontdir, which primarily generates fonts.dir files listing font files and their canonical X font names. mkfontscale focuses specifically on the scaling capabilities of fonts, making them accessible to applications running within the X environment.

CAVEATS

mkfontscale primarily deals with font scaling information for X servers. While its output can be consumed by modern font systems like fontconfig, desktop environments often rely more heavily on direct fontconfig configurations for comprehensive font management. Issues related to complex font rendering or font fallback are typically handled by fontconfig rather than mkfontscale.

PURPOSE OF <I>FONTS.SCALE</I>

The fonts.scale file generated by mkfontscale is specifically designed to contain information about scalable fonts, such as TrueType and Type1 fonts. It lists the font names along with their scaling properties, allowing the X server to dynamically generate various sizes of a font on the fly. This contrasts with fonts.dir, which primarily lists bitmap fonts or specific fixed sizes of scalable fonts.

INTEGRATION WITH <I>FONTCONFIG</I>

Although mkfontscale primarily targets the X server's native font mechanisms, fontconfig, the modern font configuration library, can also be configured to scan directories that contain fonts.scale files. This allows the information generated by mkfontscale to be leveraged within a more unified and flexible font management system, bridging older X font paths with contemporary font rendering practices.

HISTORY

mkfontscale is a long-standing utility that originated as part of the core X Window System font utilities. It has been a fundamental component of the X.Org distribution since its inception, evolving alongside the X server and its font rendering capabilities. Its continued purpose is to make fonts available and correctly scaled within the X environment, often working in conjunction with more modern font rendering systems like fontconfig.

SEE ALSO

mkfontdir(1), xset(1), X(7), fontconfig(3), fonts.conf(5)

Copied to clipboard