aboutsummaryrefslogtreecommitdiff
path: root/font
diff options
context:
space:
mode:
Diffstat (limited to 'font')
-rw-r--r--font/src/darwin/mod.rs1
-rw-r--r--font/src/ft/mod.rs2
-rw-r--r--font/src/lib.rs1
3 files changed, 4 insertions, 0 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs
index 9e92923e..cd27c6e2 100644
--- a/font/src/darwin/mod.rs
+++ b/font/src/darwin/mod.rs
@@ -334,6 +334,7 @@ impl Font {
Metrics {
average_advance: average_advance,
line_height: line_height,
+ descent: self.ct_font.descent() as f32,
}
}
diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs
index c04057cd..e1086372 100644
--- a/font/src/ft/mod.rs
+++ b/font/src/ft/mod.rs
@@ -64,10 +64,12 @@ impl ::Rasterize for FreeTypeRasterizer {
let width = (size_metrics.max_advance / 64) as f64;
let height = (size_metrics.height / 64) as f64;
+ let descent = (size_metrics.descender / 64) as f32;
Ok(Metrics {
average_advance: width,
line_height: height,
+ descent: descent,
})
}
diff --git a/font/src/lib.rs b/font/src/lib.rs
index 292e2244..8428ec18 100644
--- a/font/src/lib.rs
+++ b/font/src/lib.rs
@@ -219,6 +219,7 @@ impl fmt::Debug for RasterizedGlyph {
pub struct Metrics {
pub average_advance: f64,
pub line_height: f64,
+ pub descent: f32,
}
pub trait Rasterize {