Commit graph

91 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
42ed90bc6f
Fix clippy::default_trait_access 2023-09-20 04:51:08 +02:00
Héctor Ramón Jiménez
3450987355
Invalidate existing paragraphs when new fonts are loaded 2023-09-09 11:21:32 +02:00
Héctor Ramón Jiménez
8129e2c208
Implement draw_paragraph in iced_tiny_skia 2023-09-03 08:08:27 +02:00
Héctor Ramón Jiménez
89acf0217e
Use min_bounds for cached text 2023-08-30 05:06:08 +02:00
Héctor Ramón Jiménez
ed3454301e
Implement explicit text caching in the widget state tree 2023-08-30 04:31:21 +02:00
lufte
e86363837d Make the style attribute available on Font 2023-08-18 18:46:22 -03:00
Héctor Ramón Jiménez
95ff96f71f
Update cosmic-text and glyphon 2023-07-20 20:47:38 +02:00
Héctor Ramón Jiménez
d666e739cd
Trim text measurements only before layout 2023-06-29 18:23:11 +02:00
Héctor Ramón Jiménez
98febd9a42
Introduce Mode for text::Cache and trim only when switching modes 2023-06-29 17:54:54 +02:00
Héctor Ramón Jiménez
00859c25f5
Retain text measurements as long as original entries 2023-06-28 01:27:09 +02:00
Héctor Ramón Jiménez
975eebfc62
Retain measurements for text entries even if not directly used 2023-06-28 00:51:40 +02:00
Héctor Ramón Jiménez
c8d79a5cd9
Fix needless borrow in iced_wgpu and iced_tiny_skia 2023-06-28 00:45:41 +02:00
Héctor Ramón Jiménez
73dca5e323
Reuse entries in text::Cache in iced_tiny_skia 2023-06-28 00:44:23 +02:00
Héctor Ramón Jiménez
78ad365db2
Reuse entries in text::Cache in iced_wgpu 2023-06-28 00:35:37 +02:00
Héctor Ramón Jiménez
ef87ff1e8a
Clear text caches after a font is loaded 2023-06-21 21:47:29 +02:00
Héctor Ramón Jiménez
5bc7cbf5bc
Use subpixel glyph positioning and layout linearity
... for offsetting and scaling text
2023-06-20 06:50:36 +02:00
Héctor Ramón Jiménez
0c65936664
Update glyphon and cosmic-text 2023-06-16 15:50:03 +02:00
Héctor Ramón Jiménez
b5fc0f4a3a
Use consistent color strategy in glyphon 2023-06-01 03:10:02 +02:00
Héctor Ramón Jiménez
faa7627ea4
Introduce web-colors feature flag to enable sRGB linear blending
This is how browsers perform color management. They treat
gamma-corrected sRGB colors as if they were linear RGB.

Correctness aside, this mode is introduced for legacy reasons. Most
UI/UX tooling uses this color management as well, and many have created
an intuition about how color should behave from interacting with a
browser.

This feature flag should facilitate application development with `iced`
in those cases.

More details: https://webcolorisstillbroken.com/
2023-05-31 21:31:58 +02:00
Héctor Ramón Jiménez
9a8b30d7e9
Clip text that exceeds section bounds in iced_wgpu 2023-05-08 16:41:42 +02:00
Héctor Ramón Jiménez
c6d9221ee4
Round paragraph position until we implement subpixel glyph positioning 2023-05-08 16:20:05 +02:00
Héctor Ramón Jiménez
9499a8f9e6
Support configurable LineHeight in text widgets 2023-05-04 18:39:31 +02:00
Héctor Ramón Jiménez
edf3432bf5
Update glyphon and cosmic-text 2023-05-02 01:02:33 +02:00
Héctor Ramón Jiménez
4bd290afe7
Introduce text::Shaping enum and replace magic boolean 2023-05-02 01:02:32 +02:00
Héctor Ramón Jiménez
33b5a90019
Make basic text shaping the default shaping strategy 2023-05-02 01:02:13 +02:00
Héctor Ramón Jiménez
c0431aedd3
Update wgpu and cosmic-text 2023-04-08 04:47:05 +02:00
Héctor Ramón Jiménez
0b459c8e24
Introduce font::Stretch 2023-03-30 02:01:20 +02:00
Héctor Ramón Jiménez
707de9d788
Introduce support for Font attributes 2023-03-30 00:56:00 +02:00
Héctor Ramón Jiménez
5f9e7f6cb9
Update cosmic-text to latest 🎉 2023-03-19 14:52:30 +01:00
Héctor Ramón Jiménez
ea50ec8df1
Trim text Buffer cache every frame in iced_wgpu and iced_tiny_skia 2023-03-17 19:58:42 +01:00
Héctor Ramón Jiménez
bacbaeed99
Merge branch 'advanced-text' into feature/software-renderer 2023-03-04 05:51:05 +01:00
Héctor Ramón Jiménez
3a0d34c024
Create iced_widget subcrate and re-organize the whole codebase 2023-03-04 05:37:11 +01:00
Héctor Ramón Jiménez
5fd5d1cdf8
Implement Canvas support for iced_tiny_skia 2023-03-01 21:34:26 +01:00
Héctor Ramón Jiménez
11b2c3bbe3
Reuse text buffers independently of color in iced_wgpu 2023-02-27 03:41: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
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
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
a970f34cb4
Apply ceil to text bounds when drawing 2023-02-24 13:37:30 +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
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