pub enum Cell {
Strokes(StrokeCell),
Literal(Glyph),
Symbol(SymbolCell),
}Expand description
A cell: either a base stroke with four arms, one chosen glyph, or a named symbol rendered
through the catalog. The three kinds are mutually exclusive — no cell is two and none is
neither — per The cell in docs/model.md.
Where a figure in front stamps over one behind, the kind on top decides which kind the
position ends up being, exactly as it decides the base stroke of a StrokeCell: see
Stamping in docs/model.md.
Variants§
Strokes(StrokeCell)
A base stroke and four arms.
Literal(Glyph)
One chosen glyph. Nothing connects into it, and it renders as itself without consulting any catalog.
Symbol(SymbolCell)
A symbol and the style it is drawn in. Nothing connects into it, and the catalog the renderer was handed answers the pair — or does not, which is a space.
Implementations§
Source§impl Cell
impl Cell
Sourcepub fn is_decided(&self) -> bool
pub fn is_decided(&self) -> bool
Whether the cell is already decided. For Cell::Strokes this is
StrokeCell::is_decided; a Cell::Literal and a Cell::Symbol are decided on all
four sides by definition, since neither has an arm to leave undecided.
Sourcepub fn glyph_str<'a>(&'a self, glyphs: &'a GlyphCatalog) -> Option<&'a str>
pub fn glyph_str<'a>(&'a self, glyphs: &'a GlyphCatalog) -> Option<&'a str>
The text this cell renders to. A literal answers with its own text directly, without
consulting glyphs; a symbol answers with the glyph filed under its pair, and nothing if
the catalog holds no such pair; a stroke cell is looked up by StrokeCell::key first
and StrokeCell::degraded_key second, answering None if glyphs has no rule for
either. See Rendering in docs/model.md.