style: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always.

Differential Revision: https://phabricator.services.mozilla.com/D23426
This commit is contained in:
Cameron McCormack 2019-03-21 04:50:47 +00:00 committed by Emilio Cobos Álvarez
parent d5f208e18c
commit d4635f1d12
3 changed files with 42 additions and 8 deletions

View file

@ -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()
}