Font Organizer is a powerful Python-based tool for managing and organizing font collections. It provides intelligent font detection, automated organization, subsetting capabilities, and comprehensive analysis features to help you manage large font libraries efficiently.
- π Smart Font Detection: Automatically discover fonts across your system
- π Intelligent Organization: Sort and categorize fonts by various criteria (family, style, weight)
- π€ Font Subsetting: Extract specific character sets for optimized web fonts
- π Analysis Tools: Examine font metrics, character coverage, and OpenType features
- π High Performance: Efficient processing of large font collections with multi-threading support
- π Duplicate Detection: Find and manage duplicate fonts by hash and metadata
- π Reporting: Generate detailed HTML/PDF reports about your font collection
pip install font-organizeruv pip install font-organizergit clone https://github.com/twardoch/font-organizer.git
cd font-organizer
pip install -e .# Scan a directory for fonts
font-organizer scan ~/Fonts
# Organize fonts by family
font-organizer organize ~/Fonts --by family --output ~/OrganizedFonts
# Get information about a specific font
font-organizer info ~/Fonts/Arial.ttf
# Find duplicate fonts
font-organizer duplicates ~/Fonts
# Create a subset with basic Latin characters
font-organizer subset input.ttf output.woff2 --text "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"font-organizer --helpAvailable commands:
scan- Scan directories for font filesorganize- Organize fonts using various criteriaanalyze- Analyze font collections and generate reportssubset- Create font subsets with specific charactersduplicates- Find and manage duplicate fontsinfo- Display detailed font informationconfig- Manage configuration settings
Font Organizer can be configured using a YAML configuration file:
# ~/.font-organizer/config.yaml
organize:
default_scheme: family # family, style, weight, or custom
copy_mode: true # true for copy, false for move
scan:
include_system_fonts: true
recursive: true
font_extensions:
- .ttf
- .otf
- .woff
- .woff2
subset:
default_format: woff2
optimize: true# Organize by multiple criteria
font-organizer organize ~/Fonts --by family,weight --output ~/Organized
# Use custom organization rules
font-organizer organize ~/Fonts --rules my-rules.yaml --output ~/Organized
# Dry run to preview organization
font-organizer organize ~/Fonts --dry-run# Generate comprehensive analysis report
font-organizer analyze ~/Fonts --output report.html
# Export font list to CSV
font-organizer analyze ~/Fonts --format csv --output fonts.csv
# Check character coverage
font-organizer analyze ~/Fonts --coverage "Latin,Cyrillic"# Create subset with Unicode ranges
font-organizer subset input.ttf output.woff2 --unicodes "U+0020-007F,U+00A0-00FF"
# Subset for specific language
font-organizer subset input.ttf output.woff2 --language en,es,fr
# Keep specific OpenType features
font-organizer subset input.ttf output.woff2 --features "kern,liga"from font_organizer import FontOrganizer, FontInfo
# Initialize organizer
organizer = FontOrganizer()
# Scan for fonts
fonts = organizer.scan_directory("~/Fonts")
# Get font information
for font_path in fonts:
info = FontInfo(font_path)
print(f"{info.family} - {info.style} ({info.weight})")
print(f" Characters: {len(info.characters)}")
print(f" Features: {', '.join(info.features)}")
# Organize fonts
organizer.organize(
source="~/Fonts",
destination="~/OrganizedFonts",
scheme="family"
)
# Find duplicates
duplicates = organizer.find_duplicates("~/Fonts")
for group in duplicates:
print(f"Duplicate group ({len(group)} files):")
for font in group:
print(f" - {font}")# Clone the repository
git clone https://github.com/twardoch/font-organizer.git
cd font-organizer
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
# Run linting
ruff check src tests
mypy src tests# Run all tests
pytest
# Run with coverage
pytest --cov=font_organizer --cov-report=html
# Run specific test file
pytest tests/test_font_info.pyFull documentation is available at https://twardoch.github.io/font-organizer/
Contributions are welcome! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with fonttools for font manipulation
- Uses rich for beautiful terminal output
- Powered by fire for CLI interface
Adam Twardoch - @adamtwar - adam+github@twardoch.com
Project Link: https://github.com/twardoch/font-organizer