Closed RazrFalcon closed 8 months ago
I should study how the
shared_buffer
crate makes it save.
By only ever using raw pointers to access the buffer, and offering APIs that make copies of the data. The API functions are marked #[inline]
to tell the compiler to aggressively inline them, so this should not impose unnecessary overhead in practice.
About the second option, HB itself most of the time doesn't open the file, so it's a user problem. As in: we have added API for opening the file, but that's secondary to the main API that just takes memory and ownership type and uses it.
FWIW, FreeType also opens files with mmap...
I’d be fine with saying that it is a user problem. That lets the caller decide whether to user mmap()
or not. It’s up to you to do with the API that opens the file directly.
Another difference is that Rust programs generally abort()
when out of memory, whereas my understanding is that Harfbuzz tries to recover in at least some cases. This is purely a decision made by the Rust standard library, not a language requirement, and there is work being done to support falliable allocation. In particular, Rust in the Linux kernel uses falliable allocation exclusively.
Are we going to move forward with anything discussed in this issue (official support, or just community absorption)? It's certainly important for many use cases, especially (in my case) no_std
. swash
does not support no_std
, and as far as I know, no other library does. This seems to be the only shaping library that can run in that environment.
There have been recent efforts to continue with the backport (see the commit history). @RazrFalcon is currently also trying to change the structure of rustybuzz to make it more similar to harfbuzz, which will make adding new changes easier in the future. But I presume that this will take a while, since it's a huge undertaking...
But once that's done, we can continue with backporting.
@lylythechosenone the current status is: very slowly catching up.
No deprecation for now, so I will close it.
Please, update top of README with such great news! :)
The readme is up to date.
@laurmaedje Hi! I'm giving up on this project. I have no further plans on working on it. I know you're using it in
typst
, so it's probably affects you. I plan to either archive it or pass to someone else.As for
resvg
, which is the reason this projects exists, I haven't decided yet. But basically I have a "choice" of using this deprecated version for now, switch to harfbuzz bindings or try outswash
(I'm very skeptical).