Skip to content

A CLI tool used to generate glyph atlases for graphics applications such as GUI, video games and so on to improve performance of these applications.

License

Notifications You must be signed in to change notification settings

ii887522/font-packer

Repository files navigation

font-packer

Semantic Versioning 2.0.0 Linux Windows made-with-rust MIT license

Sample font atlas

A CLI tool used to generate glyph atlases for graphics applications such as GUI, video games and so on to improve performance of these applications.

Table of contents

Usage

font-packer <input-dir-path> <output-dir-path>

input-dir-path is an input directory path where the directory is located contains a list of TTF font files and a input.toml file that contains a list of TOML tables called fonts. Each TOML table in fonts must include a variable called file_name which is a relative path to TTF font file, a variable called size that specify font size in pts, and optionally contains a variable called generate_blur which is a boolean that specify whether to generate blur glyphs for the associated font.

output-dir-path is an output directory path where the directory is located contains a generated font atlas file and a glyph reference file in TOML format. Each glyph reference inside the TOML file points to a small area of the texture atlas. That small area is actually an image (rotated or not) which comes from the input directory.

Prerequisites

Format the project

cargo fmt

Automatically format the project on change

cargo watch -x fmt

Lint the project

cargo clippy --all-features

Automatically lint the project on change

cargo watch -x "clippy --all-features"

Build vcpkg dependencies in the project

cargo vcpkg build

Build the project

cargo build

Automatically build the project on change

cargo watch -x build

Test the project

cargo test

Automatically test the project on change

cargo watch -x test

Run the project

cargo run

About

A CLI tool used to generate glyph atlases for graphics applications such as GUI, video games and so on to improve performance of these applications.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks