diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-22 13:19:48 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-22 13:19:48 +0100 |
| commit | 760936af4961060b3be4e6088953e4f070cd7e70 (patch) | |
| tree | f33c4099a6281f8a6b386d84609b521e36a2f39e /src | |
| parent | 79d851cd0bb864da8de980965472c2b7f2fbdb1f (diff) | |
Remove ReX
Diffstat (limited to 'src')
| -rw-r--r-- | src/font/mod.rs | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/font/mod.rs b/src/font/mod.rs index 0422f3b9..ab94e093 100644 --- a/src/font/mod.rs +++ b/src/font/mod.rs @@ -10,9 +10,7 @@ use std::fmt::{self, Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::sync::Arc; -use once_cell::unsync::OnceCell; -use rex::font::MathHeader; -use ttf_parser::{GlyphId, Tag}; +use ttf_parser::GlyphId; use crate::geom::Em; use crate::util::Buffer; @@ -37,8 +35,6 @@ struct Repr { ttf: ttf_parser::Face<'static>, /// The underlying rustybuzz face. rusty: rustybuzz::Face<'static>, - /// The parsed ReX math header. - math: OnceCell<Option<MathHeader>>, } impl Font { @@ -58,15 +54,7 @@ impl Font { let metrics = FontMetrics::from_ttf(&ttf); let info = FontInfo::from_ttf(&ttf)?; - Some(Self(Arc::new(Repr { - data, - index, - info, - metrics, - ttf, - rusty, - math: OnceCell::new(), - }))) + Some(Self(Arc::new(Repr { data, index, info, metrics, ttf, rusty }))) } /// Parse all fonts in the given data. @@ -131,17 +119,6 @@ impl Font { // internal 'static lifetime. &self.0.rusty } - - /// Access the math header, if any. - pub fn math(&self) -> Option<&MathHeader> { - self.0 - .math - .get_or_init(|| { - let data = self.ttf().raw_face().table(Tag::from_bytes(b"MATH"))?; - MathHeader::parse(data).ok() - }) - .as_ref() - } } impl Hash for Font { |
