diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-12-12 22:19:38 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-12-12 22:19:38 +0100 |
| commit | ff107cf3e75acf041f8b7631337d299cdeaa1685 (patch) | |
| tree | 40799f0337a5c2bc13166ff32a1f0b4f5c23bfe8 /src/layout | |
| parent | 3c0496bb6104f0e2a60520e42137ecc29f26e9fa (diff) | |
Tidying up 🧹
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 22 | ||||
| -rw-r--r-- | src/layout/text.rs | 3 | ||||
| -rw-r--r-- | src/layout/tree.rs | 5 |
3 files changed, 16 insertions, 14 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index fa3a8866..363eb14b 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -2,14 +2,10 @@ use std::io::{self, Write}; use smallvec::SmallVec; +use toddle::query::SharedFontLoader; -use toddle::query::{FontClass, SharedFontLoader}; - -use crate::TypesetResult; -use crate::func::Command; use crate::size::{Size, Size2D, SizeBox}; -use crate::style::{LayoutStyle, TextStyle}; -use crate::syntax::{Node, SyntaxTree, FuncCall}; +use crate::style::LayoutStyle; mod actions; mod tree; @@ -25,8 +21,11 @@ pub mod layouters { pub use super::text::{layout_text, TextContext}; } -pub use actions::{LayoutAction, LayoutActions}; -pub use layouters::*; +pub use self::actions::{LayoutAction, LayoutActions}; +pub use self::layouters::*; + +/// The result type for layouting. +pub type LayoutResult<T> = crate::TypesetResult<T>; /// A collection of layouts. pub type MultiLayout = Vec<Layout>; @@ -368,8 +367,8 @@ pub enum SpacingKind { /// The standard spacing kind used for paragraph spacing. const PARAGRAPH_KIND: SpacingKind = SpacingKind::Soft(1); -/// The standard spacing kind used for normal spaces between boxes. -const SPACE_KIND: SpacingKind = SpacingKind::Soft(2); +/// The standard spacing kind used for line spacing. +const LINE_KIND: SpacingKind = SpacingKind::Soft(2); /// The last appeared spacing. #[derive(Debug, Copy, Clone, PartialEq)] @@ -416,6 +415,3 @@ impl Serialize for MultiLayout { Ok(()) } } - -/// The result type for layouting. -pub type LayoutResult<T> = TypesetResult<T>; diff --git a/src/layout/text.rs b/src/layout/text.rs index 5ecc40cc..af74df13 100644 --- a/src/layout/text.rs +++ b/src/layout/text.rs @@ -1,8 +1,9 @@ use toddle::query::{SharedFontLoader, FontQuery, FontClass}; use toddle::tables::{CharMap, Header, HorizontalMetrics}; -use super::*; use crate::size::{Size, Size2D}; +use crate::style::TextStyle; +use super::*; /// The context for text layouting. /// diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 195b6075..9c909d9c 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -1,4 +1,9 @@ use smallvec::smallvec; +use toddle::query::FontClass; + +use crate::func::Command; +use crate::syntax::{SyntaxTree, Node, FuncCall}; +use crate::style::TextStyle; use super::*; /// Layout a syntax tree into a multibox. |
