Skip to main content

Crate fop_layout

Crate fop_layout 

Source
Expand description

Layout engine for Apache FOP

This crate implements the layout algorithms that transform the FO tree into an area tree suitable for rendering.

§Architecture

The layout process follows these steps:

  1. Area Tree Generation: Convert FO tree to area tree
  2. Block Layout: Position block-level areas vertically
  3. Inline Layout: Position inline-level areas horizontally with line breaking
  4. Page Breaking: Split content across pages

§Example

use fop_layout::LayoutEngine;
use fop_core::FoArena;

// Assume we have an FO tree in `arena`
let engine = LayoutEngine::new();
let area_tree = engine.layout(&arena).unwrap();

Re-exports§

pub use area::Area;
pub use area::AreaId;
pub use area::AreaTree;
pub use area::AreaType;
pub use layout::properties::measure_text_width;
pub use layout::ColumnWidth;
pub use layout::KnuthPlassBreaker;
pub use layout::LayoutEngine;
pub use layout::ListLayout;
pub use layout::ListMarkerStyle;
pub use layout::PageBreaker;
pub use layout::TableLayout;

Modules§

area
Area tree data structures
layout
Layout algorithms

Enums§

FopError
Base error type for FOP operations

Type Aliases§

Result
Result type alias for FOP operations