diff --git a/src/doc.rs b/src/doc.rs index 4f87a7f2a..d6568ecd7 100644 --- a/src/doc.rs +++ b/src/doc.rs @@ -24,7 +24,7 @@ pub struct Page { pub actions: Vec, } -/// A series of text layouting actions. +/// A text layouting action. #[derive(Debug, Clone)] pub enum TextAction { /// Move from the _start_ of the current line by an (x, y) offset. diff --git a/src/font.rs b/src/font.rs index 1a31c6811..6b074e735 100644 --- a/src/font.rs +++ b/src/font.rs @@ -395,8 +395,8 @@ impl<'p> FontLoader<'p> { } drop(state); - // The outermost loop goes over the families because we want to serve - // the font that matches the first possible family. + // The outermost loop goes over the families because we want to serve the font that matches + // the first possible family. for family in &query.families { // For each family now go over all font infos from all font providers. for (provider, infos) in self.providers.iter().zip(&self.provider_fonts) { @@ -405,9 +405,9 @@ impl<'p> FontLoader<'p> { if Self::matches(&query, family, info) { let mut state = self.state.borrow_mut(); - // Check if we have already loaded this font before, otherwise, we will - // load it from the provider. Anyway, have it stored and find out its - // internal index. + // Check if we have already loaded this font before, otherwise, we will load + // it from the provider. Anyway, have it stored and find out its internal + // index. let index = if let Some(&index) = state.info_cache.get(info) { index } else if let Some(mut source) = provider.get(info) { @@ -469,9 +469,9 @@ impl<'p> FontLoader<'p> { /// Move the whole list of fonts out. pub fn into_fonts(self) -> Vec { - // Sort the fonts by external index so that they are in the correct order. - // All fonts that were cached but not used by the outside are sorted to the back - // and are removed in the next step. + // Sort the fonts by external index so that they are in the correct order. All fonts that + // were cached but not used by the outside are sorted to the back and are removed in the + // next step. let mut fonts = self.state.into_inner().fonts; fonts.sort_by_key(|&(maybe_index, _)| match maybe_index { Some(index) => index, diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 1af3156d1..edcd63a78 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -80,6 +80,7 @@ pub struct LayoutContext<'a, 'p> { pub text_style: TextStyle, } +/// A space to layout in. #[derive(Debug, Clone)] pub struct LayoutDimensions { /// Horizontal extent. diff --git a/src/lib.rs b/src/lib.rs index b088f633b..dd0785f7b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -140,8 +140,6 @@ impl<'p> Typesetter<'p> { let tree = self.parse(src)?; let (layout, fonts) = self.layout(&tree)?; let document = layout.into_document(fonts); - println!("fonts = {}", document.fonts.len()); - println!("document = {:?}", document.pages); Ok(document) } }