How sile-typesetter/sile works
Main System Components
a) Input Layer:
• Multiple input formats (SIL, XML, Lua) handled by the inputters/ directory
• CLI interface (core/cli.lua) as the entry point
b) Core Processing Layer:
• Typesetting engine (core/typesetter.lua)
• Font management system (core/fontmanager.lua)
• Language processing (core/languages.lua)
• Settings management (core/settings.lua)
c) Layout Engine:
• Frame system (core/frame.lua)
• Page builder (core/pagebuilder.lua)
• Line breaking system (core/break.lua)
d) Output Layer:
• Multiple output backends (outputters/*)
• PDF generation via libtexpdf
• Cairo backend
• Debug output options
Key Relationships to Highlight
• Data flow from input through processing to output
• Plugin architecture showing how packages extend core functionality
• Language system integration with hyphenation and bidirectional text support
• Font system interaction with HarfBuzz and FontConfig
External Dependencies
• HarfBuzz for text shaping
• FontConfig for font management
• ICU for Unicode handling
• libtexpdf for PDF generation
• Lua runtime environment
Specific Implementation Details
• Core Rust components (src/)
• Lua components (core/, packages/, etc.)
• Native C/C++ components (justenough/)
• Configuration and resource files
Package System
How the package system (packages/) extends functionality:
• Core packages
• Math typesetting
• Layout packages
• Language support
• Third-party package integration