New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting egui to ereaders. Issue with text sizes after update from 13.1 to 27.2 #4456
Comments
With regular eframe apps, this happens if you don't have any fonts, i.e., you don't enable the |
Bingo, fonts were missing... somehow. A warning that they are missing would be helpful... Adding fonts only fixes the galley data missing, the text is still too small: Well anyway, I dropped epi (why was it nowhere stated that it was dropped?) and moved to eframe. Now I'm using the most recent egui for sure. The text sizes are still small and I can't change them, the I also needed to include x11 integration for winit because it needs a platform to even compile. For my use case, winit could be optional |
So if you zoom the UI, (for example by calling egui/crates/epaint/src/shape.rs Lines 50 to 53 in ded8dbd
But I don't know at what level this is supposed to be done in the integration. |
Well this does seem to do something. Idk about the text shape thing |
I think the integration crate just has to pass the correct |
I decided zoom is the solution because text_styles will only affect text Sadly, setting zoom affects the ui only for one frame. In The only thing I'm aware of doing wrong is this: How do I create a but |
The zoom factor change should be permanent. If you make this change to the hello_world example, the zoom changes to 200% when you click the button and then stays that way: M examples/hello_world/src/main.rs
@@ -46,6 +46,7 @@ impl eframe::App for MyApp {
});
ui.add(egui::Slider::new(&mut self.age, 0..=120).text("age"));
if ui.button("Increment").clicked() {
+ ui.ctx().set_zoom_factor(2.0);
self.age += 1;
}
ui.label(format!("Hello '{}', age {}", self.name, self.age)); So maybe your integration is using a new |
I don't have input yet so this example won't work. Setting zoom factor anywhere: once, every frame, only on first frame does the same thing And no, I don't create a new context every frame |
Discussed in #4440
Originally posted by Szybet May 1, 2024
Hello
I'm trying to port egui to eink devices using FBInk as the backend. Based on this I was able to achieve some good results:
The issue I was having was the small UI size as you can see. I decided to update egui from 13.1 to 27.2 and now text sizes are not calculated:
The code is here, the logs are from here and calling of next egui frames is here. The example app is here but it shouldn't matter.
Thanks!
The text was updated successfully, but these errors were encountered: