How tancredi/fantasticon works
Main Components
a. Input Layer:
• SVG Files Input Directory
• Configuration System (.fantasticonrc files)
• CLI Interface
b. Core Processing Layer:
• Configuration Parser
• Runner System
• Asset Generation Pipeline
c. Generators Layer:
• Font Generators (TTF, WOFF, WOFF2, EOT, SVG)
• Asset Generators (CSS, SCSS, SASS, HTML, JSON, TypeScript)
d. Utility Layer:
• File System Operations
• Template Processing
• Asset Utilities
• Validation Systems
┌─ Input Layer ─────┐ ┌─ Core Layer ──────┐ ┌─ Output Layer ────┐
• CLI Interface │ --> │ - Config Parser │ --> │ - Font Files │
• Config Files │ │ - Runner │ │ - Style Sheets │
• SVG Directory │ │ - Asset Generator │ │ - Type Definitions│
• ┬─┘ └─────────────────┬─┘ └─────────────────┬─┘
• > Utility Layer <─────────────────────────┘
• FS Operations
• Templates
• Validation
Key Relationships to Highlight
a. Data Flow:
• SVG Files → Configuration Parser → Asset Generation
• Configuration → Runner → Output Files
• Templates → Asset Generation → Final Assets
b. Dependencies:
• CLI depends on Configuration Parser
• Generators depend on Utility Layer
• Asset Generation depends on Font Generation
Important Details
a. Supported Input Types:
• SVG files
• Configuration files (.fantasticonrc)
b. Output Asset Types:
• Fonts: TTF, WOFF, WOFF2, EOT, SVG
• Assets: CSS, SCSS, SASS, HTML, JSON, TS
c. Configuration Options:
• Font options (height, descent, normalize)
• Asset options (templates, formats)
• Path options
Implementation Notes
• The modular nature of the generator system
• The extensibility of asset types
• The configuration flexibility
• The template-based generation system