* Refactor text layout: don't need &Fonts in all functions
* Replace indexing in Fonts with member function
* Wrap Fonts in a Mutex
* Remove mutex for Font::glyph_info_cache
* Remove RwLock around Font::characters
* Put FontsImpl and GalleyCache behind the same Mutex
* Round font sizes to whole pixels before deduplicating them
* Make TextStyle !Copy
* Implement user-named TextStyle:s
* round font size earlier
* Cache fonts based on family and size
* Move TextStyle into egui and Style
* Remove body_text_style
* Query graphics about max texture size and use that as font atlas size
* Recreate texture atlas when it is getting full
* Move texture allocation into epaint/egui proper
* Add TextureHandle
* egui_glow: cast using bytemuck instead of unsafe code
* Optimize glium painter
* Optimize WebGL
* Add example of loading an image from file
Changes:
* New `BarChart` and `BoxPlot` diagrams
* New `FloatOrd` trait for total ordering of float types
* Refactoring of existing plot items
Co-authored-by: niladic <git@nil.choron.cc>
* Move window building to egui-winit
* Move icon loading to egui-winit
* `use glow::HasContext;` -> `use glow::HasContext as _;`
* Move FileStorage into epi behind a feature flag
* De-duplicate screen_size_in_pixels and native_pixels_per_point
* Move creation of FileStorage to epi
* Handle epi app output (window size changes etc) in egui-winit
* Move app and memory persistence and autosave logic to egui-winit
* fix check.sh
* Make the epi backend opt-in for egui_glium and egui_glow
* Fix persistence
* Add integration name to epi::IntegrationInfo and the demo
* Clean up Cargo.toml files and fix making egui_glium optional
* fix typo
* Make egui_glium compile without the `epi` feature
I've extracted all the http request code and turned it
into its own crate at <https://github.com/emilk/ehttp>.
There was never a reason for the HTTP request library to be part of
`eframe`. Much better to have it as its own crate!
This PR introduces a completely rewritten text layout engine which is simpler and more powerful. It allows mixing different text styles (heading, body, etc) and formats (color, underlining, strikethrough, …) in the same layout pass, and baked into the same `Galley`.
This opens up the door to having a syntax-highlighed code editor, or a WYSIWYG markdown editor.
One major change is the color is now baked in at layout time. However, many widgets changes text color on hovered. But we need to do the text layout before we know if it is hovered. Therefor the painter has an option to override the text color of a galley.
## Performance
Text layout alone is about 20% slower, but a lot of that is because more tessellation is done upfront. Text tessellation is now a lot faster, but text layout + tessellation still lands at a net loss of 5-10% in performance. There are however a few tricks to speed it up (like using `smallvec`) which I am saving for later. Text layout is also cached, meaning that in most cases (when all text isn't changing each frame) text tessellation is actually more important (and that's more than 2x faster!).
Sadly, the actual text cache lookup is significantly slower (300ns -> 600ns). That's because the `TextLayoutJob` is a lot bigger (it has more options, like underlining, fonts etc), so it is slower to hash and compare. I have an idea how to speed this up, but I need to do some other work before I can implement that.
All in all, the performance impact on `demo_with_tesselate__realistic` is about 5-6% in the red. Not great; not terrible. The benefits are worth it, but I also think with some work I can get that down significantly, hopefully down to the old levels.
* First pass (missing rendering the bar)
* Render horizontal bars, and change Window scroll API
* emath: add impl Index + IndexMut for Align2
* Scrolling: fix subtle sizing bugs
* Add horizontal scrolling to color test
* try to wrap content before showing scrollbars, + add auto-shrink option
* Add hscroll to the misc demo window
* Fix for putting wrapping labels in an infinitely wide layout
* Add a egui_asserts to protect against nans in the layout engine
* Add line about horizontal scrolling to changelog
* Add example to docs of ScrollArea
* code cleanup
* Allow using the layout cursor to restrict available area
* Avoid id clashes when putting panels inside a Ui
* Panels: Propagate height/width range to inner Ui
* Allow easy placement of panels inside of Ui:s
* demo: simplify Windows with Panels demo
* Use old 1.51 toolchain instead of bleeding edge
1.52 and 1.53 has problems with incremental compilation,
so some people chose to stay on 1.51 for now.
So let's make sure egui supports 1.51 for a while!
* Update to cint 0.2.2 to get rust 1.51.0 compatability
* Deny doc errors
* Add intentional bad intradoc link to test CI
* Add cargo doc to CI
* Fix carg doc web (add wasm32 target)
* Fix intentionally broken doc-link