Basic support for bidirectional text

This commit is contained in:
Matt Brubeck 2015-06-26 08:19:29 -07:00
parent b386d7ae44
commit dfac8ce4a1
20 changed files with 309 additions and 107 deletions

View file

@ -85,6 +85,14 @@ impl WritingMode {
(true, false) => PhysicalSide::Left,
}
}
#[inline]
/// The default bidirectional embedding level for this writing mode.
///
/// Returns 0 if the mode is LTR, or 1 otherwise.
pub fn to_bidi_level(&self) -> u8 {
!self.is_bidi_ltr() as u8
}
}
impl fmt::Display for WritingMode {