mooman219 / fontdue

The fastest font renderer in the world, written in pure rust.
Apache License 2.0
1.44k stars 72 forks source link

Attach user data to glyph layout structs #44

Closed bschwind closed 4 years ago

bschwind commented 4 years ago

From #43

This is some experimental code from what I discussed in the issue. I added both approaches in this code but really only one solution is sufficient:

Note: the way I implemented it, GlyphPosition will have an extra field the size of a reference (8 bytes typically) for the user data. I don't know if this is a dealbreaker for you or not. There may be a way to make that go away if you opt to not supply user data, this article may have some hints.

Let me know what you think!

bschwind commented 4 years ago

@mooman219 Sorry, forgot to push the changes for removing the text_style_index code!

mooman219 commented 4 years ago

No worries, I'm about to push a first rewrite attempt, but I'll merge this first