fop_layout/lib.rs
1//! Layout engine for Apache FOP
2//!
3//! This crate implements the layout algorithms that transform the FO tree
4//! into an area tree suitable for rendering.
5//!
6//! # Architecture
7//!
8//! The layout process follows these steps:
9//!
10//! 1. **Area Tree Generation**: Convert FO tree to area tree
11//! 2. **Block Layout**: Position block-level areas vertically
12//! 3. **Inline Layout**: Position inline-level areas horizontally with line breaking
13//! 4. **Page Breaking**: Split content across pages
14//!
15//! # Example
16//!
17//! ```no_run
18//! use fop_layout::LayoutEngine;
19//! use fop_core::FoArena;
20//!
21//! // Assume we have an FO tree in `arena`
22//! # let arena = FoArena::new();
23//! let engine = LayoutEngine::new();
24//! let area_tree = engine.layout(&arena).unwrap();
25//! ```
26
27pub mod area;
28pub mod layout;
29
30pub use area::{Area, AreaId, AreaTree, AreaType};
31pub use fop_types::{FopError, Result};
32pub use layout::properties::measure_text_width;
33pub use layout::{
34 ColumnWidth, KnuthPlassBreaker, LayoutEngine, ListLayout, ListMarkerStyle, PageBreaker,
35 TableLayout,
36};