| Crates.io | typst_font_manager |
| lib.rs | typst_font_manager |
| version | 0.1.2 |
| created_at | 2025-01-06 22:23:24.931511+00 |
| updated_at | 2025-12-27 12:56:01.913326+00 |
| description | A CLI tool to manage fonts for Typst projects |
| homepage | |
| repository | https://github.com/hooyuser/typst_font_manager |
| max_upload_size | |
| id | 1506271 |
| size | 190,943 |
A CLI tool to manage fonts for Typst projects.
You can install this Typst Font Manager CLI named typfont using one of the following three methods:
cargo-binstall (Recommended)cargo-binstall allows you to quickly download and install pre-compiled binaries.
Install cargo-binstall if you haven’t already.
Run the following command:
cargo binstall typst_font_manager
This method ensures you get the latest pre-built binary with minimal setup.
Visit the Releases Page.
Download the appropriate binary for your platform. You can choose either a compressed file or an uncompressed binary file.
Rename the binary to:
typfont (Linux/macOS)typfont.exe (Windows)if you downloaded an uncompressed executable file.
Move the binary to a directory included in your system's PATH.
cargoIf you prefer building from source, run:
cargo install typst_font_manager
This method requires Rust and Cargo to be installed on your system.
To use this font manager CLI tool with your Typst project, place a font configuration file named font_config.toml in the same directory as your Typst file *.typ.
Below is an example font_config.toml file that explicitly specifies 5 fonts from 3 font families:
font_dir = "fonts"
[[fonts]]
family_name = "Noto Sans"
style = "Normal"
weight = [400, 600, 700]
[[fonts]]
family_name = "Noto Sans Display"
style = "Normal"
weight = 500
[[fonts]]
family_name = "STIXTwoText"
style = "Italic"
weight = 400
Font Directory:
font_dir = "fonts" to specify the subdirectory where font files are stored.fonts.Explicit Font Variants:
Font Family Naming:
family_name matches the names shown by the typst fonts command.Weight Specification:
[400, 600, 700] to specify multiple font weights explicitly.Default Style and Weight:
style is omitted, the default is "Normal". No fuzzy matching is applied.weight is omitted, the default is 400.The following steps outline how to explicitly set up font dependencies for your local Typst project by strictly specifying the font variants you want to use.
Ctrl+Shift+P) and search for summary.Typst: Show current document summary, and in the newly opened page, scroll down to view all fonts currently used in your Typst project./Users/goodguy/font_libRemove any existing font files from your Typst project (consider backing them up first).
Run the following command:
cd path_to_your_typst_project
typfont check -l "/Users/goodguy/font_lib"
This command will display:
If all required fonts are present in the library, you’re good to proceed.
typfont update -l "/Users/goodguy/font_lib"
typfont check -l "/Users/goodguy/font_lib"
To minimize unexpected font fallback and ensure strict font management, use the following command when compiling your Typst document:
typst compile foo.typ foo.pdf --ignore-system-fonts --font-path fonts
Additionally, add this line to your Typst file:
#set text(fallback: false)
This prevents Typst from falling back to unintended font variants, ensuring consistent and reproducible results across your project.
By following these steps, you'll have precise control over font management in your Typst projects, minimizing font-related issues and ensuring clarity in your setup.
If you want to avoid tracking numerous font files in your Typst project's GitHub repository, this CLI tool can help streamline the process.
typfont check-lib -l "/Users/goodguy/font_lib" -o
font_library.toml at the root path of your font library.gooduserfont_libIn your GitHub Actions workflow, download the latest release of this CLI tool.
Run the following command to download fonts from your remote font library into your GitHub Actions worker:
typfont update -l "gooduser/font_lib" -g
For reference, you can check one of my CI workflow examples: Example CI Workflow