A command-line tool for searching and analyzing font files based on various criteria.
- Search for fonts based on:
- OpenType variation axes (e.g., weight, width)
- OpenType features (e.g., small caps, old-style numerals)
- OpenType scripts (e.g., Latin, Cyrillic)
- Font tables (e.g., GPOS, GSUB)
- Unicode character support
- Font name patterns
- Progressive output for immediate feedback
- Parallel processing for improved performance
- Output in text or JSON format
# From crates.io
cargo install fontgrep
# From source
git clone https://github.com/twardoch/fontgrep.git
cd fontgrep
cargo install --path .Download pre-built binaries from the releases page:
- Linux:
fontgrep-linux-x86_64.tar.gz - macOS:
fontgrep-macos-x86_64.tar.gz(Intel) orfontgrep-macos-aarch64.tar.gz(Apple Silicon) - Windows:
fontgrep-windows-x86_64.exe.zip
docker run --rm -v $(pwd):/fonts ghcr.io/twardoch/fontgrep:latest /fontsFor detailed installation instructions, see INSTALL.md.
# Find variable fonts
fontgrep --variable /path/to/fonts
# Find fonts with specific features
fontgrep -f smcp,onum /path/to/fonts
# Find fonts supporting specific scripts
fontgrep -s latn,cyrl /path/to/fonts
# Find fonts by name pattern
fontgrep -n "Roboto.*Mono" /path/to/fonts
# Find fonts supporting specific Unicode ranges
fontgrep -u "U+0041-U+005A,U+0061-U+007A" /path/to/fonts
# Find fonts with specific tables
fontgrep -T GPOS,GSUB /path/to/fonts
# Find fonts supporting specific text
fontgrep -t "Hello World" /path/to/fonts# Find variable fonts with small caps feature
fontgrep --variable -f smcp /path/to/fonts
# Find fonts supporting both Latin and Cyrillic scripts
fontgrep -s latn,cyrl /path/to/fonts
# Find fonts with specific name pattern and features
fontgrep -n "Roboto" -f liga,kern /path/to/fonts# Output in JSON format
fontgrep -j /path/to/fonts
# Combine JSON output with search criteria
fontgrep -j -f smcp,onum /path/to/fonts-a, --axes <AXES>: Comma-separated list of OpenType variation axes to search for (e.g., wght,wdth)-f, --features <FEATURES>: Comma-separated list of OpenType features to search for (e.g., smcp,onum)-s, --scripts <SCRIPTS>: Comma-separated list of OpenType script tags to search for (e.g., latn,cyrl)-T, --tables <TABLES>: Comma-separated list of OpenType table tags to search for (e.g., GPOS,GSUB)-v, --variable: Only show variable fonts that support OpenType Font Variations-n, --name <NAME>: Regular expressions to match against font names-u, --codepoints <CODEPOINTS>: Unicode codepoints or ranges to search for (e.g., U+0041-U+005A,U+0061)-t, --text <TEXT>: Text string to check for support-J, --jobs <JOBS>: Number of parallel jobs to use (defaults to CPU core count)--verbose: Enable verbose output-j, --json: Output results in JSON format-h, --help: Print help information-V, --version: Print version information
- Uses memory mapping for efficient font file access
- Employs parallel processing for searching and font analysis
- Provides progressive output for immediate feedback
git clone https://github.com/twardoch/fontgrep.git
cd fontgrep
make build# Run all tests
make test
# Run specific test types
make test-unit
make test-integration
make test-doc# Set up development environment
make setup
# Run quick development checks
make check
# Run full CI pipeline locally
make ci
# Generate code coverage
make coverage
# Run security audit
make audit
# Check binary size
make size# Prepare a new release
make release patch # or minor, major, or specific version
# The release script will:
# 1. Run tests and build
# 2. Update version in Cargo.toml
# 3. Update CHANGELOG.md
# 4. Create git tag
# 5. Push to trigger CI/CD pipeline# Build Docker image
make docker-build
# Run with testdata
make docker-runContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
make test) - Run quality checks (
make check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Run make help to see all available targets.
Due to permission requirements, GitHub Actions workflows need to be set up manually. See WORKFLOWS.md for detailed instructions on setting up CI/CD pipelines for automated testing, building, and releasing.
This project is licensed under the MIT License - see the LICENSE file for details.