Skip to main content

Crate takumi_core

Crate takumi_core 

Source
Expand description

The layout engine shared by every takumi output. It holds the node tree, the CSS cascade, layout, text shaping, and font and image resources. Its block, inline, flexbox, grid, and table layout port Chromium’s Blink.

Each backend builds on these types: takumi-raster for images, takumi-svg for SVG, and the PDF and paint-tree builds behind the takumi-pdf and takumi-paint npm packages.

Depend on the takumi crate instead. Its prelude re-exports the stable subset of these types.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use crate::resources::font::Fonts;

Modules§

blur
Gaussian blur of pixels, as Skia’s raster blur engine runs it. Gaussian blur as Skia’s raster SkBlurEngine runs it for Chrome’s filters and text shadows. Follows Skia under the notice in LICENSE-CHROMIUM.
context
Render context threading style, sizing, and resources through layout.
error
Error types.
filter
A CSS filter function as a colour matrix. The colour-matrix CSS filter functions, as Filter Effects defines each feColorMatrix.
font_style
Font style resolved against a sizing context.
form_control
HTML form control state, read from attributes.
geometry
Transform geometry helpers shared across backends.
html
Parse HTML markup into a takumi Node tree.
keyframes
@keyframes rules and animation timing. Shared keyframe input parsing used by external bindings.
layout
Style resolution and box/inline layout.
math
Deterministic float math shared by the painting paths. Float math that renders the same on every platform, unlike libm, for finite pixel-scale inputs.
page_stream
A render tree laid out a page at a time, painted from the pages that settle. A render tree laid out a page at a time, with the pages no later page can paint on handed out.
paint
Backend painting helpers (gradient LUTs, tile positioning, transfer tables) shared with the raster and SVG renderers.
paint_chunk
A scene flattened into paint chunks in paint order, and the conversion that moves a device between their clip and effect states, after Blink’s PaintChunk and the ConversionContext in paint_chunks_to_cc_layer.cc.
paint_property
Clip and effect trees every painted box refers to, after Blink’s paint property trees.
paint_tree
A paint document: what the backends paint for a node tree, in device pixels, recorded instead of drawn.
painter
The seam between deciding what to paint and painting it.
path_data
Compact SVG path d data, as SVG output and the paint document write it.
resources
Font and image resource management.
scene
Backend-agnostic paint scene: the stacking-context tree that decides paint order, grouping, and bounds.
shadow
Box, text, and inset shadow resolution.
style
CSS value types, parsing, and the cascade.
units
CSS absolute length units in 96 dpi pixels, shared by every crate.
viewport
Viewport dimensions and device-pixel-ratio resolution.