mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
d5f208e18c
commit
d4635f1d12
3 changed files with 42 additions and 8 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue