MFEK / math.rlib

A library which supplies mathematics and algorithms for manipulating beziers.
Apache License 2.0
7 stars 4 forks source link

Make skia optional #29

Closed simoncozens closed 1 year ago

simoncozens commented 1 year ago

This, along with https://github.com/MFEK/glifparser.rlib/pull/63, makes it possible to build math.rlib and have good stuff like variable width stroking but without pulling in Skia. This is useful if you want to run variable width stroking in, oh I don't know, restricted environments like WebAssembly.

Screenshot 2022-11-23 at 09 52 28
MatthewBlanchard commented 1 year ago

Looks good to me. I don't see any issues, but I'll wait for Fred to chime in to make a pull request.

Also seeing VWS in the web looks super dope, mind sharing more about it? One of our long-term goals is making sure everything is WebAssembly ready, and I'd love to know what the performance is like in the browser.

ctrlcctrlv commented 1 year ago

@simoncozens Do you have any issue signing MFEK/CLA.md? It's equivalent to Google's CLA just with MFEK Fndn Inc. instead. If not I'll merge both of these.

ctrlcctrlv commented 1 year ago

Thanks for this and MFEK/glifparser.rlib#63. It was always my intention that this be possible, so it was just an oversight it wasn't actually exposed.

simoncozens commented 1 year ago

@MatthewBlanchard: So it's half a real project. Someone suggested that when developing fonts for language communities which don't have much typographic tradition, you may need to explore different treatments of styles that may not necessarily translate into their script. ("What would a 'bold' mean for Toto?") And a good way to do that would be to start from a skeleton and look at how the counters etc. change with different stroke angles, pen treatments, etc. I've been interested in what we can do with skeletons and path stroking for a while, so this fits.

But mainly it's an excuse to play with WebAssembly and Rust.

ctrlcctrlv commented 1 year ago

(This has nothing to do with anything, but just by the way, the rust-skia project has supported wasm builds for quite a while now.)

simoncozens commented 1 year ago

It has? I got a build failure because it wanted math.h and couldn't find it. But hey, smaller binaries are better.

ctrlcctrlv commented 1 year ago

Yes, I tested it. See https://github.com/rust-skia/rust-skia/pull/611 and https://github.com/rust-skia/rust-skia/pull/638.

But hey, smaller binaries are better.

Which is why it has nothing to do with anything ! :-)