alexheretic/ab-glyph

Support laying out text using rustbuzz

notgull opened this issue · 5 comments

This crate looks very good, and I wanted to use it in combination with rustbuzz to lay out text. However, it looks like there is no support for accessing the underlying ttf_parser font (unless I missed something). I assume that you don't want to make it a public dependency. Therefore, it would be nice if there was some way (with a feature gate or something) to enable a function that would layout text using rustbuzz.

You can already layout glyphs using this crate however you choose, though layout functionality isn't provided here nor is it intended to be.

I haven't used rustbuzz so I'm not sure what's lacking to integrate with it.

If you want to access the underlying ttf_parser::Face I would simply use ttf-parser directly.

You can already layout glyphs using this crate however you choose, though layout functionality isn't provided here nor is it intended to be.

Yes, however proper shaping usually needs direct access to the underlying fonts.

I haven't used rustbuzz so I'm not sure what's lacking to integrate with it.

Rustbuzz needs either the ttf-parser face or a byte slice of the raw face. ab-glyph exposes neither of these items from a FontRef or FontVec. I think that exposing the byte slice would fix this issue.

If you want to access the underlying ttf_parser::Face I would simply use ttf-parser directly.

Then I would need to juggle a ttf_parser::Face and a ab_glyph::Face, which feels redundant since both are the same structure.

I think that exposing the byte slice would fix this issue.

For FontRef you can just keep hold of the slice used to construct it. For FontVec we could perhaps add as_slice & into_vec methods.

#73 will enable this, I can publish that at the end of the week. Will that be enough to resolve this issue?

Yes, #73 would close this issue.