diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-12-17 15:43:30 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-12-17 15:43:30 +0100 |
| commit | 6f111f941008f10ddc06e6f56da9e3582e90d2c4 (patch) | |
| tree | 0ee44f6c9d88353320893522cf14931863ddf742 /src/library/style.rs | |
| parent | 7e91c8dc87e345ee38b934375d113e824a423a2b (diff) | |
Test [font] 🧣
Diffstat (limited to 'src/library/style.rs')
| -rw-r--r-- | src/library/style.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/library/style.rs b/src/library/style.rs index 804e9424..c641a598 100644 --- a/src/library/style.rs +++ b/src/library/style.rs @@ -71,13 +71,6 @@ pub fn font(mut args: Args, ctx: &mut EvalContext) -> Value { } } - let mut needs_flattening = false; - let list: Vec<_> = args.find_all::<StringLike>().map(|s| s.to_lowercase()).collect(); - if !list.is_empty() { - Rc::make_mut(&mut ctx.state.font.families).list = list; - needs_flattening = true; - } - if let Some(style) = args.get::<_, FontStyle>(ctx, "style") { ctx.state.font.variant.style = style; } @@ -90,6 +83,13 @@ pub fn font(mut args: Args, ctx: &mut EvalContext) -> Value { ctx.state.font.variant.stretch = stretch; } + let mut needs_flattening = false; + let list: Vec<_> = args.find_all::<StringLike>().map(|s| s.to_lowercase()).collect(); + if !list.is_empty() { + Rc::make_mut(&mut ctx.state.font.families).list = list; + needs_flattening = true; + } + for (class, dict) in args.find_all_str::<Spanned<ValueDict>>() { let fallback = Args(dict) .find_all::<StringLike>() @@ -100,12 +100,12 @@ pub fn font(mut args: Args, ctx: &mut EvalContext) -> Value { needs_flattening = true; } - args.done(ctx); - if needs_flattening { Rc::make_mut(&mut ctx.state.font.families).flatten(); } + args.done(ctx); + if let Some(body) = body { body.eval(ctx); ctx.state = snapshot; |
