1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -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:
StratusFearMe21
2025-03-20 04:03:17 -06:00
committed by GitHub
parent 1545dec7a8
commit 52732b23a6

View File

@@ -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.