linebender / skribo

A Rust library for low-level text layout.
Apache License 2.0
327 stars 35 forks source link

Why provide Unicode functions in Rust rather than use Harfbuzz’s default? #20

Open SimonSapin opened 5 years ago

SimonSapin commented 5 years ago

Compare https://github.com/linebender/skribo/commit/51ed7899f0adeede2b79b14bc43167a0a8a00eb2 with https://github.com/harfbuzz/harfbuzz/blob/master/CONFIG.md#unicode-functions

By default, HarfBuzz ships with its own compact subset of properties from Unicode Character Database that it needs. This is a highly-optimized implementation that depending on compile settings (optimize-size or not) takes around ~40kb or ~60kb. Using this implementation (default) is highly recommended, as HarfBuzz always ships with data from latest version of Unicode. This implementation can be disabled by defining HB_NO_UCD.

raphlinus commented 5 years ago

The short answer is so they can be accessed from Rust also, but maybe we use HB's and ffi into those.

I didn't think these were included in the harfbuzz-sys crate, but if I'm wrong, happy to be corrected.