Skip to main content

typst_library/visualize/
mod.rs

1//! Drawing and visualization.
2
3mod color;
4mod curve;
5mod gradient;
6mod image;
7mod line;
8mod paint;
9mod polygon;
10mod shape;
11mod stroke;
12mod tiling;
13
14pub use self::color::*;
15pub use self::curve::*;
16pub use self::gradient::*;
17pub use self::image::*;
18pub use self::line::*;
19pub use self::paint::*;
20pub use self::polygon::*;
21pub use self::shape::*;
22pub use self::stroke::*;
23pub use self::tiling::*;
24
25use crate::foundations::Scope;
26
27/// Hook up all visualize definitions.
28pub(super) fn define(global: &mut Scope) {
29    global.start_category(crate::Category::Visualize);
30    global.define_type::<Color>();
31    global.define_type::<Gradient>();
32    global.define_type::<Tiling>();
33    global.define_type::<Stroke>();
34    global.define_elem::<ImageElem>();
35    global.define_elem::<LineElem>();
36    global.define_elem::<RectElem>();
37    global.define_elem::<SquareElem>();
38    global.define_elem::<EllipseElem>();
39    global.define_elem::<CircleElem>();
40    global.define_elem::<PolygonElem>();
41    global.define_elem::<CurveElem>();
42    global.reset_category();
43}