aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/font_metrics.rs
diff options
context:
space:
mode:
authorCameron McCormack <cam@mcc.id.au>2019-03-21 04:50:47 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-03-27 14:29:18 +0100
commitd4635f1d126ea90d09d00051063fdbfee0abea79 (patch)
tree0434419720fa2b8269f1e77e1fee882eb37d13b9 /components/style/font_metrics.rs
parentd5f208e18c67cd4ec61f1d9210b6185ba162d317 (diff)
downloadservo-d4635f1d126ea90d09d00051063fdbfee0abea79.tar.gz
servo-d4635f1d126ea90d09d00051063fdbfee0abea79.zip
style: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always.
Differential Revision: https://phabricator.services.mozilla.com/D23426
Diffstat (limited to 'components/style/font_metrics.rs')
-rw-r--r--components/style/font_metrics.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/style/font_metrics.rs b/components/style/font_metrics.rs
index c1707d1fbc1..15b5fd453e8 100644
--- a/components/style/font_metrics.rs
+++ b/components/style/font_metrics.rs
@@ -20,6 +20,16 @@ pub struct FontMetrics {
pub zero_advance_measure: Option<Au>,
}
+/// Type of font metrics to retrieve.
+#[derive(Clone, Debug, PartialEq)]
+pub enum FontMetricsOrientation {
+ /// Get metrics for horizontal or vertical according to the Context's
+ /// writing mode.
+ MatchContext,
+ /// Force getting horizontal metrics.
+ Horizontal,
+}
+
/// A trait used to represent something capable of providing us font metrics.
pub trait FontMetricsProvider {
/// Obtain the metrics for given font family.
@@ -27,7 +37,8 @@ pub trait FontMetricsProvider {
&self,
_context: &crate::values::computed::Context,
_base_size: crate::values::specified::length::FontBaseSize,
- ) -> FontMetricsQueryResult {
+ _orientation: FontMetricsOrientation,
+ ) -> FontMetrics {
Default::default()
}