Skip to main content

Module json

Module json 

Source
Expand description

Measurements as JSON, from generators as a project holds them: the one form the wasm binding and the Python package return.

Enums§

MeasureError
Why a generator could not be measured.

Functions§

measure_layout_json
Where each node of the layout generator generator_json, as a project holds it, lies on a width by height picture at picture time time (crate::measure_layout), as JSON { nodes }: each node in preorder as { at, border, content, overflow, lineCount, baselines }, its boxes in fractions of the picture, lineCount null for a node without text and baselines ({ first, last }, fractions of the picture height) null for a node without text or with empty text. canvas is the project canvas its pixels are pixels of: the picture’s size when None.
measure_text_json
Where the text generator generator_json, as a project holds it, lies on a width by height canvas (crate::measure_text), as JSON { layout, content, ink, lineCount, baselines }: each a { left, top, right, bottom } rectangle in fractions of the canvas, ink null when the text draws nothing, and baselines { first, last } in fractions of the canvas height.