summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/mod.rs6
-rw-r--r--src/layout/text.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index ab27314d..1c1f743e 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -144,8 +144,8 @@ impl Default for PageStyle {
/// The error type for layouting.
pub enum LayoutError {
- /// There was no suitable font.
- NoSuitableFont,
+ /// There was no suitable font for the given character.
+ NoSuitableFont(char),
/// An error occured while gathering font data.
Font(FontError),
}
@@ -156,7 +156,7 @@ pub type LayoutResult<T> = Result<T, LayoutError>;
error_type! {
err: LayoutError,
show: f => match err {
- LayoutError::NoSuitableFont => write!(f, "no suitable font"),
+ LayoutError::NoSuitableFont(c) => write!(f, "no suitable font for '{}'", c),
LayoutError::Font(err) => write!(f, "font error: {}", err),
},
source: match err {
diff --git a/src/layout/text.rs b/src/layout/text.rs
index 11a1e38c..d1e2afd7 100644
--- a/src/layout/text.rs
+++ b/src/layout/text.rs
@@ -104,7 +104,7 @@ impl<'a, 'p> TextLayouter<'a, 'p> {
italic: self.italic,
bold: self.bold,
character,
- }).ok_or_else(|| LayoutError::NoSuitableFont)
+ }).ok_or_else(|| LayoutError::NoSuitableFont(character))
}
/// The width of a char in a specific font.