1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! The [`Span`] trait: one styled run within a line of
//! [`Text`](crate::text::Text).
//!
//! A line is a sequence of spans laid out left-to-right. A span can shape
//! itself — given the base style it inherits from the enclosing `Text` —
//! into placed vector paths plus the vertical metrics the line needs to
//! position it. Normal `Text` rendering may coalesce adjacent compatible
//! built-in spans first so cross-boundary kerning and formula layout are
//! preserved. [`TextSpan`](crate::text::TextSpan) is the ordinary styled-text
//! span; with the `latex` feature, [`MathSpan`](crate::math::MathSpan) renders
//! a LaTeX formula as another kind of span. Anything implementing `Span` flows
//! into `Text::builder().span(...)`.
use Any;
use ;
use Arc;
use crate;
use crate;
use crate;
/// The base style the enclosing [`Text`](crate::text::Text) hands to each
/// span. A span uses these wherever it does not override them.
/// The geometry and metrics one span contributes to a line.
///
/// `paths` are in span-local, baseline-relative coordinates: x starts at
/// `0` and the text baseline is at `y = 0`, with y increasing downward
/// (so ink above the baseline has negative y). The enclosing `Text`
/// advances the pen by `width` and drops the span onto the line baseline.
/// One run within a line of [`Text`](crate::text::Text).
///
/// Implementors shape themselves into placed paths given the inherited
/// base style. The super-traits let `Box<dyn Span>` live in the cache-key
/// component trees that drive render memoization: [`DynEq`]/[`DynHash`]
/// give it `PartialEq`/`Eq`/`Hash`, and [`SpanClone`] makes it cloneable.
// Compile-time guarantee that `Span` is dyn-safe.
const _: = None;
/// Clone support for `Box<dyn Span>`. Blanket-implemented for every
/// `Span` that is `Clone`; callers never implement it by hand.
// Identity of a `dyn Span` is its concrete type plus that type's own
// equality/hash — the same trait-object machinery `VectorComponent` uses,
// so a `Box<dyn Span>` participates in derived cache keys.