NemuiSen / ggegui

A simple implementation of egui for ggez
51 stars 30 forks source link

Changing text styles may cause an error #41

Open DamienPup opened 2 months ago

DamienPup commented 2 months ago

Attempting to change the change the egui text styles to anything that isn't the default, such as this sample from eguis docs:

style.text_styles = [
            (Heading, FontId::new(30.0, Proportional)),
            (Name("Heading2".into()), FontId::new(25.0, Proportional)),
            (Name("Context".into()), FontId::new(23.0, Proportional)),
            (Body, FontId::new(18.0, Proportional)),
            (Monospace, FontId::new(14.0, Proportional)),
            (Button, FontId::new(14.0, Proportional)),
            (Small, FontId::new(10.0, Proportional)),
        ].into();

Or even a simpler edit like this:

style.text_styles.insert(egui::TextStyle::Heading, egui::FontId::proportional(16.0)); // reduce size of headers

May cause Error: Non-zero offset texture updates are not implemented yet to be printed to the console and the text to fail to display on screen. Sometimes it's works, sometimes it doesn't. I can't really tell what will and won't work, except for knowing that the defaults always work (regardless of which style are applied to)

NemuiSen commented 2 months ago

I cannot repair this due to ggez since I do not have greater control when creating textures, at another time I am going to make a change to the ggez library and if they accept it I will repair this.

SkuliAdams commented 1 month ago

I'm having the same problem when applying the .size() method to the text going into a label. In the meantime, do you know of any workaround that might help?