Commit graph

265 commits

Author SHA1 Message Date
Audrey Dutcher
58d292a6f1 Add FontSystem::into_locale_and_db for std system 2023-01-04 18:41:26 -07:00
Audrey Dutcher
92b3758909 Add ExactSizeIterator impl for LayoutRunsIter 2023-01-04 18:41:26 -07:00
Audrey Dutcher
06ad8ff7fb run cargo check next time thx 2023-01-04 18:41:26 -07:00
Audrey Dutcher
5533af1a53 Add FontSystem::new_with_locale_and_db for std system 2023-01-04 18:41:26 -07:00
Audrey Dutcher
cd15418315 Add BufferLine::into_text 2023-01-04 18:41:26 -07:00
Andrew Wheeler
8614a7a398 Updated RangeMap to Add Clear(). 2022-12-30 08:33:00 -07:00
Hojjat
b9fef72f76 Added an enum with the option for "No Wraping" 2022-12-20 13:38:34 -07:00
Hojjat
48087b592b Updated Doc String 2022-12-20 13:37:21 -07:00
Jeremy Soller
cf9bf26d49
0.6.0 2022-12-20 09:03:39 -07:00
Jeremy Soller
0e302e540a
0.5.6 2022-12-20 08:58:17 -07:00
Hojjat
1454a53b21 Glyph based wrapping implemeted 2022-12-20 04:48:53 -07:00
Hojjat
a4ed73b664 Simplify the layout algorithm 2022-12-20 04:48:53 -07:00
Hojjat
1bc476c06e This solves a few bugs:
Fixes long words in BiDi text.
Fixes issues with small text area and large font (no duplicates)
But I feel I need to rewirte this function. It's too convluted and ugly
2022-12-20 04:48:53 -07:00
Hojjat
499e6ccb06 Bug fix: duplicate lines in specific conditions. 2022-12-20 04:48:53 -07:00
Hojjat
8beeca2822 Fix duplicate visual lines when a word is too long
Words longer than the linewidth used to show up duplicated
2022-12-20 04:48:53 -07:00
Hojjat
e38a302599 Make ShapeWord::x/y_advance pub 2022-12-20 04:48:53 -07:00
Hojjat
25a3367ef9 Turn a consequtive whitespaces into separate words
Currently a sequence like this "hello      " (a word followed by
6 spaces). Would be shaped into two words: ["hello     " , " "]
This causes issues, since the first word is only 5 letters long,  not 10
This commit will break this sequence into:
["hello", " ", " ", " ", " ", " ", " "]
This helps with correct line wrappipng
2022-12-20 04:48:53 -07:00
Hojjat
3ef56b7112 Ignore the last space when wrapping. 2022-12-20 04:48:53 -07:00
Hojjat
cb958c63f8 Clean up 2022-12-20 04:48:53 -07:00
Hojjat
089a926615 Bidi reordering works with wrapping. 2022-12-20 04:48:53 -07:00
Jeremy Soller
82d5fc02a5
0.5.5 2022-12-16 13:51:05 -07:00
Héctor Ramón Jiménez
034c5248d9 Replace unless ... not with simply if ... in docs 2022-12-16 13:50:40 -07:00
Héctor Ramón Jiménez
be6dea75a8 Clarify when to use x_offset and y_offset in LayoutGlyph 2022-12-16 13:50:40 -07:00
Héctor Ramón Jiménez
01f6c1fd89 Expose subpixel offsets in LayoutGlyph 2022-12-16 13:50:40 -07:00
Jeremy Soller
ac28f5d77c
Update dependencies 2022-12-15 14:48:27 -07:00
Jeremy Soller
ba39c81656
Fix no_std compilation 2022-12-15 14:31:19 -07:00
Héctor Ramón Jiménez
be4dc2749c Fix line width in LayoutLine for RTL 2022-12-15 11:17:54 -07:00
Héctor Ramón Jiménez
67950724c3 Add line width field to LayoutLine 2022-12-15 11:17:54 -07:00
Héctor Ramón Jiménez
652543f9aa Implement method to obtain glyph outlines
This is useful for drawing text with non-bitmap based renderers (e.g. vectorial, tessellators, etc.).
2022-12-14 23:45:45 -07:00
Jeremy Soller
445da52efb
Fix inverted colors in libcosmic example 2022-12-14 09:24:54 -07:00
Jeremy Soller
21e0078d25
cargo upgrade 2022-12-14 09:21:42 -07:00
Jeremy Soller
d54af47d9d
0.5.4 2022-12-14 09:19:20 -07:00
Jeremy Soller
8bf0032974
Add custom metadata to Attrs, copied to ShapeGlyph and LayoutGlyph 2022-12-14 09:19:03 -07:00
Jeremy Soller
cdf36db03d
0.5.3 2022-12-13 09:23:50 -07:00
Jeremy Soller
f5968c4c37
Only do glyph wrapping if wrap_simple is enabled 2022-12-13 09:23:35 -07:00
Jeremy Soller
6660a1d95b
0.5.2 2022-12-08 11:33:53 -07:00
Jeremy Soller
dd94bc634b
Do not wrap empty lines 2022-12-08 11:33:36 -07:00
Jeremy Soller
3d60d55309
Add comment for last change 2022-12-08 10:35:13 -07:00
Jeremy Soller
69e41a558c
0.5.1 2022-12-08 10:32:10 -07:00
Jeremy Soller
a30576e1eb
Skip blank words at start of line 2022-12-08 10:31:44 -07:00
Jeremy Soller
d22c0f43d4
Update to latest libcosmic 2022-12-06 08:49:32 -07:00
Jeremy Soller
05d97f0f3a
Make noto color emoji have a higher preference for fallback 2022-12-02 08:41:38 -07:00
Hojjat
cd64388451 Added BiDi example to demonstrate reordering works
and disabled `wrap simple` since it's not working properly.
2022-12-02 08:30:16 -07:00
Hojjat
c344eec936 This fixes the bidi layout issue.
Needs more testing and cleaning up the previous algorithm.
2022-12-02 08:30:16 -07:00
Jeremy Soller
2342bf0eae
Add more vi commands 2022-11-21 15:49:12 -07:00
Jasper Bekkers
e6df88f698
Add cargo-deny to the CI of this crate (#45) 2022-11-21 04:40:06 -07:00
Jasper Bekkers
6249b0e037
🍮 Add custom font support (#43)
* 🍮 Add custom font support

* Revert incorrect change
2022-11-21 04:36:18 -07:00
Jeremy Soller
425f741982
0.5.0 2022-11-15 12:27:23 -07:00
Jeremy Soller
ee54e7626b
Vi-style editor and other editor improvements (#40)
* WIP VI wrapper for editor

* WIP: block cursor

* Create Edit trait, run CI on all feature options

* Add prints describing build steps to ci.sh

* Custom rendering for Vi editor

* Clippy fixes

* More clippy fixes

* Show clippy results in CI

* Fix for Redox

* Fix clippy lint

* Add vi feature to enable vi-style editor

* Add escape to libcosmic text box
2022-11-15 12:26:59 -07:00
Andrew Wheeler(Genusis)
271ca5cf7a
Converted attr range to use RangeMap BTree (#41)
* Converted attr range to use RangeMap BTree

* Change get_span() to use First index instead of range.

* update doc comment
2022-11-14 11:05:34 -07:00