Created
March 9, 2023 04:07
-
-
Save bu5hm4nn/f377cf60397b70c536481280f85a0fda to your computer and use it in GitHub Desktop.
Get glyph width in Rust egui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let char = 'C'; | |
let width = ui.fonts(|f| -> f32 { | |
f.glyph_width(&TextStyle::Body.resolve(ui.style()), char) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment