From 0a087cd28bbee5fcdffbb9d49b0ba9f413ad7f92 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 24 Jan 2020 16:23:57 +0100 Subject: =?UTF-8?q?Reorganize=20modules=20=F0=9F=A7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/library/font.rs | 7 ++++--- src/library/layout.rs | 3 ++- src/library/mod.rs | 1 + src/library/page.rs | 2 ++ src/library/spacing.rs | 5 ++++- 5 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/library') diff --git a/src/library/font.rs b/src/library/font.rs index b4a6218a..07707e90 100644 --- a/src/library/font.rs +++ b/src/library/font.rs @@ -1,4 +1,5 @@ use toddle::query::{FontWeight, FontStyle}; +use crate::size::FSize; use super::*; @@ -79,7 +80,7 @@ function! { #[derive(Debug, Clone, PartialEq)] pub struct FontSizeFunc { body: Option, - size: Option, + size: Option, } parse(header, body, ctx, errors, decos) { @@ -93,11 +94,11 @@ function! { layout(self, ctx, errors) { styled(&self.body, ctx, self.size, |t, s| { match s { - ScaleSize::Absolute(size) => { + FSize::Absolute(size) => { t.base_font_size = size; t.font_scale = 1.0; } - ScaleSize::Scaled(scale) => t.font_scale = scale, + FSize::Scaled(scale) => t.font_scale = scale, } }) } diff --git a/src/library/layout.rs b/src/library/layout.rs index fb8633b1..87e9c357 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -1,4 +1,5 @@ -use smallvec::smallvec; +use crate::size::PSize; +use crate::syntax::func::maps::{AxisMap, PosAxisMap}; use super::*; diff --git a/src/library/mod.rs b/src/library/mod.rs index e706642f..b570c48b 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -1,5 +1,6 @@ //! The standard library. +use crate::syntax::Scope; use crate::func::prelude::*; pub_use_mod!(font); diff --git a/src/library/page.rs b/src/library/page.rs index 25f81bc1..7e135f59 100644 --- a/src/library/page.rs +++ b/src/library/page.rs @@ -1,4 +1,6 @@ +use crate::size::Size; use crate::style::{Paper, PaperClass}; +use crate::syntax::func::maps::{AxisMap, PaddingMap}; use super::*; diff --git a/src/library/spacing.rs b/src/library/spacing.rs index 6c818292..907d5f9b 100644 --- a/src/library/spacing.rs +++ b/src/library/spacing.rs @@ -1,5 +1,8 @@ +use crate::size::FSize; +use crate::layout::SpacingKind; + use super::*; -use ContentKind::*; +use self::ContentKind::*; function! { -- cgit v1.2.3