impl AsRef<[u8]> for FontData (#5757)
* [x] I have followed the instructions in the PR template This PR implements `AsRef<[u8]>` for `FontData`, allowing it to be passed into `fontdb`'s [`Source`](https://docs.rs/fontdb/0.16.2/fontdb/enum.Source.html) type. This would allow `egui` and `cosmic_text` to share font data with eachother
This commit is contained in:
parent
1545dec7a8
commit
52732b23a6
|
|
@ -144,6 +144,12 @@ impl FontData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AsRef<[u8]> for FontData {
|
||||||
|
fn as_ref(&self) -> &[u8] {
|
||||||
|
self.font.as_ref()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/// Extra scale and vertical tweak to apply to all text of a certain font.
|
/// Extra scale and vertical tweak to apply to all text of a certain font.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue