diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-10-10 20:54:13 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-10-10 21:04:10 +0200 |
| commit | 9ac125dea8d6ea6cc01814d04413225845b69d65 (patch) | |
| tree | c7dabcda703e5f5b2704c67920efc490f2f8fb57 /src/layout/par.rs | |
| parent | d4cc8c775d4c579aeac69ca2d212a604c67043b0 (diff) | |
Rename `State` to `Style` and move it into its own module
Diffstat (limited to 'src/layout/par.rs')
| -rw-r--r-- | src/layout/par.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/par.rs b/src/layout/par.rs index 7f087eb3..cf37f005 100644 --- a/src/layout/par.rs +++ b/src/layout/par.rs @@ -6,7 +6,7 @@ use unicode_bidi::{BidiInfo, Level}; use xi_unicode::LineBreakIterator; use super::*; -use crate::eval::FontState; +use crate::style::TextStyle; use crate::util::{EcoString, RangeExt, SliceExt}; type Range = std::ops::Range<usize>; @@ -29,7 +29,7 @@ pub enum ParChild { /// Spacing between other nodes. Spacing(Linear), /// A run of text and how to align it in its line. - Text(EcoString, Align, Rc<FontState>, Vec<Decoration>), + Text(EcoString, Align, Rc<TextStyle>, Vec<Decoration>), /// Any child node and how to align it in its line. Any(LayoutNode, Align, Vec<Decoration>), } @@ -139,11 +139,11 @@ impl<'a> ParLayouter<'a> { items.push(ParItem::Spacing(resolved)); ranges.push(range); } - ParChild::Text(_, align, state, decos) => { + ParChild::Text(_, align, style, decos) => { // TODO: Also split by language and script. for (subrange, dir) in split_runs(&bidi, range) { let text = &bidi.text[subrange.clone()]; - let shaped = shape(ctx, text, dir, state); + let shaped = shape(ctx, text, dir, style); items.push(ParItem::Text(shaped, *align, decos)); ranges.push(subrange); } |
