Skip to main content

Crate rustyfi_backend

Crate rustyfi_backend 

Source
Expand description

Box/glue model, typesetting context, line and page breaking — the port of upstream src/backend/.

Re-exports§

pub use context::default_script_space_map;
pub use context::Context;
pub use context::HyphenLang;
pub use context::Language;
pub use context::MathCmdId;
pub use context::MathScriptLevel;
pub use context::PageGeometry;
pub use context::PaperSize;
pub use context::Script;
pub use context::ScriptFont;
pub use doc::Annot;
pub use doc::AnnotAction;
pub use doc::DocExtras;
pub use doc::DocInfo;
pub use doc::NamedDest;
pub use doc::OutlineEntry;
pub use font::char_script;
pub use font::FontKey;
pub use font::FontMetrics;
pub use font::MathConstants;
pub use font::MathCorner;
pub use font::MathVariantGlyph;
pub use font::VertVariantPolicy;
pub use graphics::graphics_bbox;
pub use graphics::linear_transform_graphics;
pub use graphics::linear_transform_path;
pub use graphics::path_bbox;
pub use graphics::shift_graphics;
pub use graphics::shift_path;
pub use graphics::Closing;
pub use graphics::Color;
pub use graphics::Dash;
pub use graphics::FrameDecoration;
pub use graphics::GraphicsElem;
pub use graphics::Path;
pub use graphics::PathSeg;
pub use graphics::Point;
pub use graphics::PrePath;
pub use graphics::Subpath;
pub use hbox::DecoId;
pub use hbox::GraphicsFnId;
pub use hbox::HookId;
pub use hbox::HorzBox;
pub use hbox::HorzStringInfo;
pub use hbox::ImageId;
pub use hbox::ImageResource;
pub use hbox::ImportedObjects;
pub use hbox::InlineMarkKind;
pub use hbox::JpegDct;
pub use hbox::ObjRepr;
pub use hbox::PdfPageResource;
pub use hbox::PureHorzBox;
pub use hbox::FORCED_BREAK_PENALTY;
pub use hbox::NO_BREAK_PENALTY;
pub use length::Length;
pub use linebreak::break_into_lines;
pub use linebreak::break_opportunities;
pub use linebreak::fit_cell;
pub use linebreak::measure_block;
pub use linebreak::natural_metrics;
pub use linebreak::BreakKind;
pub use math::default_math_variant_char;
pub use math::MathCharClass;
pub use math::MathGlyph;
pub use math::MathKind;
pub use pagebreak::chop_page;
pub use pagebreak::place_block_at;
pub use pagebreak::placed_line_extent;
pub use pagebreak::Page;
pub use pagebreak::PlacedLine;
pub use pagebreak::MIN_FIRST_ASCENDER;
pub use tabular::Cell;
pub use tabular::Paddings;
pub use tabular::TabularBox;
pub use tabular::TabularCellBox;
pub use vbox::ListMarkKind;
pub use vbox::VertBox;

Modules§

context
doc
Document-level PDF extras: link annotations, named destinations, the outline (bookmark) tree, and per-page decoration-graphics overlays. Pure data — accumulated lang-side (Interp, during fire_hooks), carried on DocumentValue::extras, emitted by both PDF writers. Upstream: annotation.ml / namedDest.ml / outline.ml.
font
graphics
The drawing data model — paths, colors, and graphics elements; the analog of upstream’s GraphicBase/PrePath/GraphicD. Everything here is already-resolved coordinates/data: no lang-side closure or deferred computation crosses into this module.
hbox
length
linebreak
Paragraph breaking. Knuth–Plass optimal line breaking over glue and discretionary breakpoints. The input model (a flat Vec<HorzBox> of strings, glue and discretionaries) matches what lineBreak.ml consumes.
math
Math value / box model: trimmed analog of math.ml’s math_kind (horzBox.ml:134) and low_math_atom (math.ml:9).
pagebreak
Page breaking: a stateless per-page chopper (chop_page) plus a fixed-origin placement helper (place_block_at). The per-page loop lives lang-side (primitives.rs’s prim_page_break), the one place that legally holds &mut Interp to apply the two scheme closures per page.
tabular
The tabular grid solver: row/column metrics, MultiCell span bookkeeping, and cell content fitting. A faithful port of v0.0.6’s src/backend/tabular.ml (main/determine_row_metrics/ determine_column_width/normalize_tabular/transpose_tabular/ solidify_tabular, cited by name below), adapted two ways:
vbox
visit
One generated, exhaustive traversal of the placed-box tree.