harfbuzz / rustybuzz

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

Support something like hb_face_create_for_tables #31

Closed jrmuizel closed 3 years ago

jrmuizel commented 3 years ago

This if useful on macOS where CoreText doesn't provide a way to get font data but is still nice to use for font discovery.

RazrFalcon commented 3 years ago

I honestly don't understand what this function is doing in the first place.

jrmuizel commented 3 years ago

It lets you create an hb_face that uses a callback to get the data for a particular font table. Firefox uses it here: https://searchfox.org/mozilla-central/rev/b32d4ca055ca9cf717be480df640f8970724a0ce/gfx/thebes/gfxFontEntry.cpp#617 And Chrome uses it in a couple of places.

RazrFalcon commented 3 years ago

Like this?

CryZe commented 3 years ago

Seems like it's the same idea, but one is pull based and the other push based