RazrFalcon / rustybuzz

A complete harfbuzz's shaping algorithm port to Rust
MIT License
498 stars 34 forks source link

Deprecation #74

Closed RazrFalcon closed 4 months ago

RazrFalcon commented 10 months ago

@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 out swash (I'm very skeptical).

DemiMarie commented 9 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.

DemiMarie commented 9 months ago

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.

lylythechosenone commented 4 months ago

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.

LaurenzV commented 4 months ago

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.

RazrFalcon commented 4 months ago

@lylythechosenone the current status is: very slowly catching up.

No deprecation for now, so I will close it.

Maximkaaa commented 4 months ago

Please, update top of README with such great news! :)

RazrFalcon commented 4 months ago

The readme is up to date.