Héctor Ramón Jiménez
ad111a1df1
Add skip_shaping flag to avoid expensive shaping when not needed
2023-04-19 00:24:43 +02:00
Jeremy Soller
9ebbc33792
Merge branch 'mut-font-system' of https://github.com/geieredgar/cosmic-text into geieredgar-mut-font-system
2023-03-17 18:15:45 -06:00
Edgar Geier
d297a6a48a
Call get_font lazily
2023-03-14 00:39:50 +01:00
Hojjat
05b069911a
Fix indices (suggestions by geieredgar)
2023-03-13 13:08:35 -06:00
Hojjat
7fa51c6404
Fixed some typos
2023-03-13 08:50:24 -06:00
Hojjat
8d503af956
bugfix: mixed ltr+rtl overflow
2023-03-12 21:37:10 -06:00
Edgar Geier
384c5c1fdc
Remove Mutex from FontSystem
2023-03-12 10:39:56 +01:00
Edgar Geier
46e9ef0246
Make BorrowedWithFontSystem borrow FontSystem mutably
2023-03-12 10:39:56 +01:00
Edgar Geier
bff5aaaea3
Make FontSystem not self-referencing
2023-03-12 10:23:54 +01:00
Edgar Geier
2c1d564d62
Update fontdb dependency to version 0.13
2023-03-03 13:07:49 +01:00
Jeremy Soller
eca804c732
Revert "Make FontSystem not self-referencing and update fontdb and rustybuzz"
2023-03-02 18:16:57 -07:00
Edgar Geier
f8bc71af0a
Update fontdb dependency to version 0.13
2023-03-03 00:53:00 +01:00
Edgar Geier
506a4194be
Make FontSystem not self-referencing
2023-03-03 00:53:00 +01:00
Edgar Geier
6c501c6640
Fix clippy warnings
2023-03-01 22:58:41 +01:00
Héctor Ramón Jiménez
4320ae6329
Use f32 instead of i32 for lengths
...
This allows users to use logical coordinates instead of physical ones.
2023-02-28 03:39:31 +01:00
Hojjat
fdd3ee83a5
Fix selection highlighting when paragraph is justified
2023-02-24 13:00:25 -07:00
Hojjat
d313713f44
Removed alignment from Buffer, added alignment per Bufferline to editor-libcosmic
2023-02-23 14:23:56 -07:00
Hojjat
27d52a12e9
Fix the trailing space
2023-02-23 13:26:21 -07:00
Hojjat
59e89bdbaa
Justified
2023-02-22 20:48:57 -07:00
Hojjat
00ff5b72f3
Align Left, Right, and Center works
2023-02-22 18:31:49 -07:00
Jeremy Soller
8cc988d374
Run cargo fmt
2023-01-04 20:03:03 -07:00
Hojjat
b9fef72f76
Added an enum with the option for "No Wraping"
2022-12-20 13:38:34 -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
Héctor Ramón Jiménez
01f6c1fd89
Expose subpixel offsets in LayoutGlyph
2022-12-16 13:50:40 -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
Jeremy Soller
8bf0032974
Add custom metadata to Attrs, copied to ShapeGlyph and LayoutGlyph
2022-12-14 09:19:03 -07:00
Jeremy Soller
f5968c4c37
Only do glyph wrapping if wrap_simple is enabled
2022-12-13 09:23:35 -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
a30576e1eb
Skip blank words at start of line
2022-12-08 10:31:44 -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
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
Jeremy Soller
268805ba0c
no_std support
2022-11-08 13:24:14 -07:00
Ian Douglas Scott
0d3fb1dd9d
Use ouroboros in FontSystem to avoid lifetime bound
...
Perhaps not quite what ouroboros is expected to be used for, but it's
not too bad, and avoiding the lifetime bound can be a huge help.
2022-11-04 10:37:32 -06:00
Jeremy Soller
ac354c3a2a
Remove AttrsList lifetime bound
2022-11-04 09:44:54 -06:00
Jeremy Soller
d49e8881fd
Use image renderer for iced text widget
2022-10-31 12:04:33 -06:00
Jeremy Soller
e4c8d4ba6b
Make attribute spans use ranges and update docs
2022-10-27 09:56:53 -06:00
Jeremy Soller
6f7e59e092
Add TODO to fix bidi ordering when character wrapping
2022-10-26 20:14:27 -06:00