Commit graph

405 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
c2bef6a345
Align glyphs in a LayoutRun to baseline 2023-06-16 02:15:44 +02:00
Jeremy Soller
3640b5e1ef
Update rustybuzz to 0.8.0 2023-06-12 11:13:51 -06:00
Jeremy Soller
79275d15e8
Merge pull request #139 from StaffEngineer/cursor
allow setting cursor
2023-06-10 06:04:41 -06:00
Dima Rets
6dba04df08 allow setting cursor 2023-06-10 12:53:34 +01:00
Jeremy Soller
b5f45f81f6
Merge pull request #124 from tigregalis/iter-bidi-para
Replace use of `str::Lines` with `unicode-bidi`-based iterator
2023-06-09 07:03:07 -06:00
Jeremy Soller
b6b03589b1
Merge pull request #127 from tigregalis/buffer-no-font-system
Allow creating a `Buffer` with no `FontSystem`
2023-06-09 07:00:30 -06:00
tigregalis
5ab509ebaa use alloc::vec instead of std::vec 2023-06-09 11:26:08 +08:00
tigregalis
053efa77b6 remove todo comment 2023-06-09 11:26:08 +08:00
tigregalis
6e336ad1cd replace use of str::lines with BidiParagraphs 2023-06-09 11:26:07 +08:00
tigregalis
e298259dd5 introduce BidiParagraphs iterator 2023-06-09 11:22:52 +08:00
tigregalis
2ed9c34796 use Buffer::new_empty in Buffer::new 2023-06-09 11:11:42 +08:00
tigregalis
cfb6760fa2 introduce Buffer::new_empty 2023-06-09 11:09:16 +08:00
Jeremy Soller
a93ec8adf8
Merge pull request #138 from StaffEngineer/allow-cursor
allow setting cursor color
2023-06-08 13:12:35 -06:00
Dima Rets
0eb08d218c allow setting cursor color 2023-06-08 20:04:56 +01:00
Jeremy Soller
9062cce140
Merge pull request #122 from hecrj/feature/shaping-switch
`Shaping` strategy selection
2023-06-08 12:47:04 -06:00
Jeremy Soller
bb176df59e
Merge pull request #128 from tigregalis/fontdb-0-14
bump `fontdb` to 0.14.1
2023-06-08 12:43:13 -06:00
Jeremy Soller
a8aa3b1122
Remove unnecessary cargo deny licenses and ignored vulnerabilities 2023-06-08 12:42:28 -06:00
Jeremy Soller
587bb5c98f
Remove syn from cargo deny skip, warn on multiple-versions 2023-06-08 12:40:55 -06:00
Jeremy Soller
39895c988a
Merge pull request #132 from trimental/monospaced-fallback
Fallback to monospaced font if Monospace family is not found
2023-06-08 12:38:17 -06:00
Jeremy Soller
ca48c86f2b
Merge pull request #131 from nicoburns/fix/non-wrapped-alignment
Fix alignment when using `Wrap::None`
2023-06-08 12:33:24 -06:00
Jeremy Soller
f0becfdb54
Fix comment typo 2023-06-08 12:32:34 -06:00
Jeremy Soller
b7f2687ada
Merge pull request #137 from bjorn3/no_ouroboros
Remove the dependency on ouroboros
2023-06-08 12:27:44 -06:00
bjorn3
95e36249d5 Remove the dependency on ouroboros
This reduces compilation time by removing a dependency on syn and other
dependencies of ouroboros_macros. In addition it saves a lot of unused
codegened methods.

On my laptop (2 core + HT) this reduces compilation time by ~20%. On a
many core system this doesn't help much though as the critical path path
consists of both ttf-parser -> rustybuzz and swash. Further gains will
likely need to be made by reducing compilation time for these crates.

Benchmark 1: cargo build
  Time (mean ± σ):     25.150 s ±  0.167 s    [User: 84.414 s, System: 7.335 s]
  Range (min … max):   24.909 s … 25.444 s    10 runs

Benchmark 1: cargo build
  Time (mean ± σ):     19.819 s ±  0.226 s    [User: 67.754 s, System: 5.592 s]
  Range (min … max):   19.492 s … 20.140 s    10 runs

The code is based on an expansion of the ouroboros macro, cleaned up to
remove all unused methods and inline most functions that are only called
once.
2023-06-08 18:00:42 +02:00
Lucas Timmins
e1e9fb5215 Fallback to monospaced font if Monospace family is not found 2023-05-20 02:05:52 +08:00
Nico Burns
8d37da51b9 Fix non-wrapped alignment 2023-05-19 02:45:35 +01:00
tigregalis
9c4fd35d8e bump fontdb to 0.14.1 2023-05-12 11:11:13 +08:00
Héctor Ramón Jiménez
b85d6a4f23
Use Vec::new instead of vec! macro 2023-04-21 20:56:11 +02:00
Héctor Ramón Jiménez
87d75531b7
Allow Shaping::Basic only if swash feature is enabled 2023-04-21 20:47:02 +02:00
Héctor Ramón Jiménez
0dce8b75d1
Fix examples 2023-04-21 20:35:59 +02:00
Héctor Ramón Jiménez
a5c548b12f
Fix syntect module 2023-04-21 20:29:56 +02:00
Héctor Ramón Jiménez
9e559e150d
Write docs for Shaping enum 2023-04-21 20:27:00 +02:00
Héctor Ramón Jiménez
0f055c0a13
Replace skip_shaping boolean with Shaping enum 2023-04-21 20:24:44 +02:00
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
bfb5eefbfa
Merge pull request #121 from CryZe/fixed-wasm-support
Fix WebAssembly support
2023-04-04 09:50:46 -06:00
Christopher Serr
a8546df7b3 Fix WebAssembly support
There was a problem in the upstream `sys-locale` crate where it assumed
that every WebAssembly target can use `wasm-bindgen` just fine. This
however is not the case, as `wasm-bindgen` and the ecosystem around it
are specifically to target the web. In reality there however are at
least the following 4 "targets" (with possibly more in the future):
 - WebAssembly on the web
 - Freestanding WebAssembly
 - WebAssembly with WASI
 - WebAssembly with Emscripten

These are all supported properly through `sys-locale` 0.3.0 now. However
because "WebAssembly on the web" unfortunately is not its own target and
instead uses `wasm32-unknown-unknown`, just like freestanding
WebAssembly, the only way to differentiate between them is through a
feature. This is the best practice and is done throughout the ecosystem.
Here the feature `wasm-web` is introduced that properly forwards it to
`sys-locale` and possibly other crates in the future.
2023-04-04 17:22:00 +02:00
Jeremy Soller
3224daa66f
0.8.0 2023-04-03 08:27:28 -06:00
Jeremy Soller
f2445987fb
Merge pull request #118 from pop-os/checked_sub
Use checked_sub to fix panic on window resize.
2023-03-31 06:43:30 -06:00
Jeremy Soller
615dc51907
Merge pull request #119 from CryZe/fix-no-std-signature
Fix `FontSystem::new_with_locale_and_db` Signature
2023-03-31 06:42:26 -06:00
13r0ck
e790e8e718 use checked_sub to fix panic on window resize.
bug link: https://github.com/iced-rs/iced/issues/1773
2023-03-30 12:40:14 -06:00
Christopher Serr
3b6373d0f4 Temporarily allow syn v1.0 in cargo deny
This temporarily allows `syn` v1.0 to be in the dependency tree as the
whole ecosystem is currently transitioning to `syn` v2.0. This process
however may take a while. The entry in the `deny.toml` should be removed
once all dependencies transitioned.
2023-03-30 20:11:45 +02:00
Jeremy Soller
3c7dc1f657
Remove monospaced from attrs 2023-03-30 08:04:52 -06:00
Christopher Serr
71281a5d79 Fix FontSystem::new_with_locale_and_db Signature
It turns out that the `no_std` version of
`FontSystem::new_with_locale_and_db` doesn't match the `std` version.
This fixes that.
2023-03-29 22:36:54 +02:00
Jeremy Soller
521acb64e0
Merge pull request #117 from CryZe/reuse-memory-in-set-text
Allow buffer reuse in `BufferLine`
2023-03-27 18:27:46 -06:00
Jeremy Soller
c8a7814974
Merge pull request #116 from CryZe/expose-rustybuzz
Expose `rustybuzz` in the public API
2023-03-27 18:26:42 -06:00
Christopher Serr
aff886da64 Allow buffer reuse in BufferLine
With the way `BufferLine::set_text` was written, you would always clone
the `String` / `str` that you are passing in, resulting in the function
almost not being any better than simply creating a new `BufferLine`.
This ensures the internal buffer is reused.
2023-03-27 23:14:40 +02:00
Christopher Serr
8a14734033 Expose rustybuzz in the public API
This exposes `rustybuzz` on top of `fontdb`. This is in particular
useful if you want to query the font for additional information. This is
already publically exposed via `Font::rustybuzz()`, but the types were
not re-exported, so it was impossible to properly use that function.
2023-03-27 23:08:32 +02:00
Jeremy Soller
6c355bf08b
Update libcosmic to fix memory leak 2023-03-24 09:59:03 -06:00
Jeremy Soller
3bb2868fbf
Update libcosmic 2023-03-24 08:05:46 -06:00
Jeremy Soller
d85f12af8b
Fix #106 with editor-libcosmic 2023-03-24 07:51:31 -06:00
Jeremy Soller
31a8427e10
Update libcosmic 2023-03-23 14:20:48 -06:00