Extract borrow of FontSystem from Buffer
This commit is contained in:
parent
bff5aaaea3
commit
057b5b6fa9
12 changed files with 381 additions and 216 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use core::ops::{Deref, DerefMut};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub use self::no_std::*;
|
||||
#[cfg(not(feature = "std"))]
|
||||
|
|
@ -10,3 +12,22 @@ mod std;
|
|||
|
||||
// re-export fontdb
|
||||
pub use fontdb;
|
||||
|
||||
pub struct BorrowedWithFontSystem<'a, T> {
|
||||
pub(crate) inner: &'a mut T,
|
||||
pub(crate) font_system: &'a 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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue