- Scroll is identified by line index and layout index, instead of just
layout index
- Shaping has the option to prune, where caches outside of the scroll
view are cleared
- Syntax editor no longer requires layout of all lines, only of lines
inside scroll
- BufferLine has a metadata field that can be used by other abstractions
to know when text was changed
This commit adds a new ShapeBuffer type, which contains some buffers tha
are commonly re-created during the shaping process. New APIs are added
that take this structure, and old APIs are turned into wrappers around
the new API.
The goal is to reduce the number of per-layout allocations that happen
in a typical layout call.
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.
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.