pub struct Glyph {
pub ch: char,
pub style: Style,
pub src: usize,
pub stop: bool,
}Expand description
One rendered character plus the source byte offset it originates from. Synthetic glyphs (a list bullet, a quote gutter) point at their block’s start, so clicking one lands the caret at the start of that block.
Fields§
§ch: char§style: Style§src: usize§stop: boolWhether the caret may rest on this glyph. Decoration — a table border
or a cell’s alignment padding — is visible but isn’t text, so the caret
steps over it instead of into it. It also can’t be a stop even in
principle: a run of decoration shares one src, and a caret can only
move by changing offset, so resting on it would pin horizontal motion.
A click still maps through src, which is why decoration points at the
text it decorates.
Real text is a stop once per grapheme cluster, on the glyph that opens it: the continuation glyphs of an emoji or an accented letter are drawn, but standing between them is standing inside a character.