mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -04:00
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:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user