cosmic-text/src/font/system/mod.rs

34 lines
653 B
Rust
Raw Normal View History

use core::ops::{Deref, DerefMut};
2022-11-08 08:43:27 -07:00
#[cfg(not(feature = "std"))]
pub use self::no_std::*;
#[cfg(not(feature = "std"))]
mod no_std;
2023-03-08 20:44:26 -07:00
#[cfg(feature = "std")]
2022-11-08 08:43:27 -07:00
pub use self::std::*;
2023-03-08 20:44:26 -07:00
#[cfg(feature = "std")]
2022-11-08 08:43:27 -07:00
mod std;
2022-12-29 08:49:48 -08:00
// re-export fontdb
pub use fontdb;
pub struct BorrowedWithFontSystem<'a, T> {
pub(crate) inner: &'a mut T,
pub(crate) font_system: &'a mut FontSystem,
}
impl<'a, T> Deref for BorrowedWithFontSystem<'a, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
self.inner
}
}
impl<'a, T> DerefMut for BorrowedWithFontSystem<'a, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.inner
}
}