Skip to content

Conversation

@prudhomm
Copy link
Member

@prudhomm prudhomm commented Dec 8, 2025

Summary

Add an install-fonts command to download and set up fonts required for XeLaTeX-based presentations and documents.

Changes

New Module: fonts.py

  • FontInstaller class for downloading and extracting font zip files
  • Support for progress indication during downloads
  • Default font sources: Marianne (French government font) and Roboto Mono
  • Idempotent installation (skips existing fonts unless --force is used)
  • List installed fonts and font files

Configuration: config.py

  • Added get_fonts_config() method for font configuration
  • New [fonts] section in sample config template:
    [tool.article-cli.fonts]
    directory = "fonts"
    
    [[tool.article-cli.fonts.sources]]
    name = "Marianne"
    url = "https://www.systeme-de-design.gouv.fr/uploads/Marianne_fd0ba9c190.zip"

CLI: cli.py

  • Added install-fonts command with options:
    • --dir: Custom installation directory (default: fonts/)
    • --force: Re-download even if fonts already exist
    • --list: List installed fonts instead of installing

Usage

# Install all configured fonts
article-cli install-fonts

# Install to specific directory
article-cli install-fonts --dir custom-fonts/

# Force re-download
article-cli install-fonts --force

# List installed fonts
article-cli install-fonts --list

Testing

  • Added 18 comprehensive tests for font installation
  • All 89/91 tests pass (2 pre-existing environment-related failures)

Closes #4

- Add fonts.py module with FontInstaller class
- Support downloading and extracting font zip files
- Default font sources: Marianne and Roboto Mono
- Add get_fonts_config() to config.py
- Add [fonts] section to sample config template
- Add install-fonts CLI command with --dir, --force, --list options
- Add comprehensive tests for font installation (18 tests)

Closes #4
@prudhomm prudhomm merged commit d3ddd59 into main Dec 8, 2025
6 checks passed
@prudhomm prudhomm deleted the 4-add-font-installation-command branch December 8, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add font installation command for XeLaTeX projects

2 participants