diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-11 23:28:35 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-11 23:29:32 +0100 |
| commit | ca6edf5283c258d8410134d678347977cb273cdd (patch) | |
| tree | b2b46ba70c054b0cbdefa06edbc5fd999cddb1fa /src/doc.rs | |
| parent | 1a390deaea040191cf0e5937bd8e1427b49db71b (diff) | |
Jump to source and preview
Diffstat (limited to 'src/doc.rs')
| -rw-r--r-- | src/doc.rs | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -15,6 +15,7 @@ use crate::geom::{ }; use crate::image::Image; use crate::model::{node, Content, Fold, StableId, StyleChain}; +use crate::syntax::Span; /// A finished document with metadata and page frames. #[derive(Debug, Default, Clone, Hash)] @@ -119,8 +120,8 @@ impl Frame { let mut text = EcoString::new(); for (_, element) in self.elements() { match element { - Element::Text(content) => { - for glyph in &content.glyphs { + Element::Text(element) => { + for glyph in &element.glyphs { text.push(glyph.c); } } @@ -499,6 +500,10 @@ pub struct Glyph { pub x_offset: Em, /// The first character of the glyph's cluster. pub c: char, + /// The source code location of the text. + pub span: Span, + /// The offset within the spanned text. + pub offset: u16, } /// An identifier for a natural language. |
