LinuxCommandLibrary

fontimage

Convert PSF fonts into images

SYNOPSIS

fontimage [options] <font_file>

PARAMETERS

-s <size>
    Specifies the font point size for rendering characters in the image.

-e <encoding>
    Sets the character encoding for the input text, e.g., latin1, utf8.

-c <char_list>
    A list of characters or character ranges to display, such as "A-Z" or "32-126".

-w <width>
    Sets the width of the output image in pixels.

-h <height>
    Sets the height of the output image in pixels.

-o <output_file>
    Specifies the path for the output image file. Defaults to "font.gif".

-r
    Renders the font at standard resolution without anti-aliasing, resulting in pixelated edges.

-f
    Renders font glyphs as solid filled shapes rather than outlines or stroked paths.

-v
    Displays the version information of the fontimage utility.

-a
    Displays all characters found within the specified font file, potentially including unassigned glyphs.

-p
    Pads characters with extra space to ensure proper separation in the output image.

-d
    Uses an older or alternative character dumping method; generally not recommended for modern use.

DESCRIPTION

The fontimage command is a utility designed to generate a GIF image from a specified font file.
It's commonly used for previewing fonts, allowing users to visualize how characters look at various sizes and with different rendering options.
This tool is particularly useful for designers, developers, or anyone needing to inspect font glyphs without installing the font system-wide or opening a dedicated font viewer.
It can render specific character ranges, adjust point sizes, and control anti-aliasing, providing a quick visual reference for a font's appearance.
The output is typically saved as a GIF file, making it easily viewable and shareable.

CAVEATS

The fontimage command primarily generates images in GIF format, which might be a limitation for users requiring other image types.
Its functionality is deeply tied to the FreeType library; issues with FreeType installation or configuration can affect its operation.
Character encoding issues can arise if the specified encoding does not match the font's actual encoding or the input character list.

COMMON USAGE

fontimage is often used to quickly check a font's appearance with specific text or character sets.
For instance, to generate an image of "Hello World" from "myfont.ttf" at 24pt, you might use: fontimage -s 24 -c "Hello World" myfont.ttf -o output.gif.
To see all ASCII characters (32-126) from a font, you could use: fontimage -s 16 -c "32-126" myfont.ttf.

DEPENDENCIES

This command relies on the FreeType library for font rendering. Ensure FreeType and its development headers are properly installed on your system for fontimage to compile and run correctly.

HISTORY

The fontimage utility is distributed as part of the FreeType font rendering library's demonstration programs.
It serves as a practical example of how to use FreeType's APIs to render fonts and manipulate glyphs, rather than being a standalone command with a distinct, long development history independent of FreeType itself.
Its primary purpose has always been to showcase FreeType's capabilities for font previewing.

SEE ALSO

ftdump(1), freetype-config(1)

Copied to clipboard