Skip to main content
Rust4PM

SymbolDef

A reusable fragment, emitted once as <symbol> and drawn with <use>.

The markup is in the symbol's own view_box coordinates. A fragment that should take the
colour of the place it is used paints with currentColor, since the renderer sets color on
the <use> element.
Used as Input

0

functions accept this type(+1 nested)

Used as Output

0

functions return this type(+8 nested)

Type Definition

20 nested items
struct— A reusable fragment, emitted once as <symbol> and drawn with <use>.
attrs:Attrs— Escape-hatch attributes available on every drawable.
id:Option<String>— The element's id.
style:Option<String>— Inline CSS, emitted as the style attribute.
id*:String— The id that NodeContent::Use, Glyph::Symbol, Separator::symbol,
markup*:String— SVG markup, emitted unescaped inside the <symbol>.
view_box*:SceneRect— An axis-aligned rectangle, given by its top-left corner and its size.
h*:f64— Height.
w*:f64— Width.
x*:f64— Left edge.
y*:f64— Top edge.

Example JSON Value

json
{
  "id": "893f8ab9",
  "markup": "example",
  "view_box": {
    "h": 0.2,
    "w": 0.2,
    "x": 0.2,
    "y": 0.2
  }
}