Commit graph

3110 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
5100b5d0a1
Introduce iced_renderer subcrate featuring runtime renderer fallback 2023-02-24 23:24:48 +01:00
Héctor Ramón
368cadd25a
Merge pull request #1697 from iced-rs/text-glyphon
Text shaping, font fallback, and `iced_wgpu` overhaul
2023-02-24 20:52:10 +01:00
Héctor Ramón Jiménez
8059c40142
Fix clippy lints 2023-02-24 13:58:17 +01:00
Héctor Ramón Jiménez
700262e05c
Fix checkbox example 2023-02-24 13:56:37 +01:00
Héctor Ramón Jiménez
b2c87cdd23
Make iced_wgpu a mandatory dependency 2023-02-24 13:39:38 +01:00
Héctor Ramón Jiménez
a0597471b8
Remove iced_glutin and iced_glow leftovers 2023-02-24 13:38:18 +01:00
Héctor Ramón Jiménez
26e902f7d8
Compute grapheme index in find_cursor_position for TextInput 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
51844c5d0c
Trim Cache every 300 frames in text::Pipeline 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
17a4d817c4
Collapse conditional and please clippy 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
2097a56b58
Provide some margin to static buffers when growing 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
0715d7d0c7
Update glyphon in iced_wgpu 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
05c787c2ef
Grow atlas in text::Pipeline when necessary 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
ddbf93a82f
Set scissoring properly in text::Pipeline 2023-02-24 13:37:32 +01:00
Héctor Ramón Jiménez
21886d7e9c
Use my GitHub fork of glyphon 2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
730d6a0756
Reuse a RenderPass as much as possible in iced_wgpu 2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
b8c1809ea1
Refactor triangle::Pipeline into prepare and render architecture
And get rid of the staging belt! 🎉
2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
23ed352e83
Fix needless borrows in image::Pipeline 2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
363966ee9e
Refactor image::Pipeline into prepare and render architecture 2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
34c963f7b3
Remove unnecessary borrow in quad::Pipeline 2023-02-24 13:37:31 +01:00
Héctor Ramón Jiménez
77b59496b0
Fix rendering order for quad::Pipeline 2023-02-24 13:37:30 +01:00
Héctor Ramón Jiménez
a970f34cb4
Apply ceil to text bounds when drawing 2023-02-24 13:37:30 +01:00
Héctor Ramón Jiménez
680ea5dcca
Refactor quad::Pipeline to prepare and render architecture 2023-02-24 13:37:30 +01:00
Héctor Ramón Jiménez
c8befa8d95
Fix useless f32 conversions and please clippy 2023-02-24 13:37:29 +01:00
Héctor Ramón Jiménez
7d4c63d411
Set Attrs::monospaced if Font::Monospace is selected 2023-02-24 13:36:03 +01:00
Héctor Ramón Jiménez
dd80772da9
Set a minimum height for Buffer of size * 1.2
This avoids text from misteriously disappearing, even if the user uses a
`height` that isn't enough to fit the text.
2023-02-24 13:36:03 +01:00
Héctor Ramón Jiménez
15d257a52a
Stop truncating the renderers in text::Pipeline
We avoid recreating buffers this way, and the amount of layers should
stay relatively low anyways.
2023-02-24 13:36:02 +01:00
Héctor Ramón Jiménez
f37b87fbab
Avoid allocating text_areas in text::Pipeline 2023-02-24 13:36:02 +01:00
Héctor Ramón Jiménez
6cf4a10906
Stop reusing SwashCache in text::Pipeline
`SwashCache` can't be easily trimmed and it's not really getting us
anything since `glyphon` already caches using a glyph atlas anyways.
2023-02-24 13:36:02 +01:00
Héctor Ramón Jiménez
32309f0140
Introduce Weight enum to font 2023-02-24 13:36:02 +01:00
Héctor Ramón Jiménez
eb3cd3a321
Fix overlay::Menu line height 2023-02-24 13:36:01 +01:00
Héctor Ramón Jiménez
a2ab9e9395
Use Pixels for Text::size 2023-02-24 13:34:59 +01:00
Héctor Ramón Jiménez
de7fc637cf
Fix test workflow 2023-02-24 13:31:20 +01:00
Héctor Ramón Jiménez
b4dd9b6d93
Update glyphon fork (sRGB support) 2023-02-24 13:31:19 +01:00
Héctor Ramón Jiménez
da4182099d
Disable std feature for twox-hash to fix Wasm build 2023-02-24 13:31:19 +01:00
Héctor Ramón Jiménez
17470bf7d3
Fix clippy lints 🎉 2023-02-24 13:31:19 +01:00
Héctor Ramón Jiménez
d2825360a7
Load Iced-Icons.ttf font in text::Pipeline::new 2023-02-24 13:29:12 +01:00
Héctor Ramón Jiménez
5a82fc654e
Use floating coordinates directly in text::Pipeline 2023-02-24 13:29:12 +01:00
Héctor Ramón Jiménez
238154af4a
Implement font::load command in iced_native 2023-02-24 13:29:11 +01:00
Héctor Ramón Jiménez
b29de28d1f
Overhaul Font type to allow font family selection 2023-02-24 13:28:24 +01:00
Héctor Ramón Jiménez
a7580e0696
Count layout_runs instead of using visible_lines in text::Pipeline::prepare 2023-02-24 13:22:58 +01:00
Héctor Ramón Jiménez
0a324f0aeb
Implement hit_test for text::Pipeline in iced_wgpu 2023-02-24 13:22:58 +01:00
Héctor Ramón Jiménez
c8e8b1a7ba
Use bounds directly for measure in text pipeline 2023-02-24 13:22:58 +01:00
Héctor Ramón Jiménez
6b70771146
Avoid unnecessary Vec allocation in text pipeline 2023-02-24 13:22:58 +01:00
Héctor Ramón Jiménez
02fc7e6e89
Trim text render_cache after rendering in iced_wgpu 2023-02-24 13:22:58 +01:00
Héctor Ramón Jiménez
1d0c44fb25
Implement basic text caching in iced_wgpu 2023-02-24 13:22:57 +01:00
Héctor Ramón Jiménez
032e860f13
Fix PickList line height 2023-02-24 13:22:56 +01:00
Héctor Ramón Jiménez
bb27982009
Convert sRGB to linear RGB for text in iced_wgpu 2023-02-24 13:20:55 +01:00
Héctor Ramón Jiménez
c68edb3278
Fix TextInput line height 2023-02-24 13:20:54 +01:00
Héctor Ramón Jiménez
98a16fd670
Implement proper text alignment support in iced_wgpu 2023-02-24 13:19:49 +01:00
Héctor Ramón Jiménez
ba258f8fbc
Implement support for multiple text layers in iced_wgpu 2023-02-24 13:19:49 +01:00