diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-11 11:30:18 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-11 11:30:18 +0200 |
| commit | 3330767c20e14a05176902a93dcefb08cb509173 (patch) | |
| tree | eb40b262d267df0e9f73bbbc4ec602183fd39dff /src/layout/par.rs | |
| parent | c28708aa196eaca247cdab6b5e8af9751b4f1dad (diff) | |
Remove props in favor of using state for everything
Diffstat (limited to 'src/layout/par.rs')
| -rw-r--r-- | src/layout/par.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/layout/par.rs b/src/layout/par.rs index 8b3cbf8b..d51bad3e 100644 --- a/src/layout/par.rs +++ b/src/layout/par.rs @@ -1,10 +1,11 @@ use std::fmt::{self, Debug, Formatter}; +use std::rc::Rc; use unicode_bidi::{BidiInfo, Level}; use xi_unicode::LineBreakIterator; use super::*; -use crate::exec::FontProps; +use crate::exec::FontState; use crate::util::{RangeExt, SliceExt}; type Range = std::ops::Range<usize>; @@ -26,7 +27,7 @@ pub enum ParChild { /// Spacing between other nodes. Spacing(Length), /// A run of text and how to align it in its line. - Text(String, FontProps, Align), + Text(String, Align, Rc<FontState>), /// Any child node and how to align it in its line. Any(AnyNode, Align), } @@ -131,11 +132,11 @@ impl<'a> ParLayout<'a> { items.push(ParItem::Spacing(amount)); ranges.push(range); } - ParChild::Text(_, ref props, align) => { + ParChild::Text(_, align, ref state) => { // 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, props); + let shaped = shape(ctx, text, dir, state); items.push(ParItem::Text(shaped, align)); ranges.push(subrange); } |
