summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz Mädje <laurmaedje@gmail.com>2019-06-02 12:39:59 +0200
committerLaurenz Mädje <laurmaedje@gmail.com>2019-06-02 12:39:59 +0200
commitc4eb4ee36261be8832b2649cc075edee188be5c7 (patch)
tree89be1ddd97f64cf5f8eaec62f67733a46766eb43
parent0274e9381064fa5942aa15b24a0a092832433859 (diff)
Fix some documentation 🚧
-rw-r--r--src/doc.rs2
-rw-r--r--src/font.rs16
-rw-r--r--src/layout/mod.rs1
-rw-r--r--src/lib.rs2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/doc.rs b/src/doc.rs
index 4f87a7f2..d6568ecd 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -24,7 +24,7 @@ pub struct Page {
pub actions: Vec<TextAction>,
}
-/// 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 1a31c681..6b074e73 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<Font> {
- // 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 1af3156d..edcd63a7 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 b088f633..dd0785f7 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)
}
}