Overview
graphitepdf-textkit is the dedicated text subsystem for GraphitePDF.
Scope
graphitepdf-textkit contains:
- authoring types such as
TextSpan,TextBlock,AttributedString, andTextAttributes - container and geometry types such as
TextRectandTextContainer - resolved output such as
TextRun,TextFragment,LineFragment, andTextLayout TextEngineandTextEngineConfigfor line-breaking, bidi, justification, and font substitution behavior
Installation
API Summary
| Category | Items |
|---|---|
| Authoring | TextSpan, TextBlock, AttributedString, AttributeRun, TextRange |
| Attributes | TextAttributes, TextDecoration, TextDecorationKind, TextDirection, Script |
| Containers | TextRect, TextContainer |
| Layout output | TextRun, TextFragment, LineFragment, TextLayout |
| Engine | TextEngine, TextEngineConfig, BidiMode, LineBreaking, Justification, FontSubstitution |
Example
use FontStore;
use ;
Design Principles
- keep text shaping and line layout centralized in one crate
- make font fallback, bidi, and line-breaking behavior configurable
- expose text results as structured data rather than ad hoc strings
- keep the text subsystem reusable for higher-level layout and rendering crates
Role In GraphitePDF
This crate is the canonical text engine that feeds layout and ultimately the rendering pipeline.
License
MIT