#46
Add a field for user IDs
There is a field UserIdOrCodepointIndex that combines user ids with something that the library auto-increments occasionally:
// This field is kept and returned as-is throughout the shaping process.
// When you are using the context API, it contains a codepoint index always!
// To get the original user ID with the context API, you need to get the corresponding kbts_shape_codepoint
// with kbts_ShapeGetShapeCodepoint(Context, Glyph->UserIdOrCodepointIndex, ...);
int UserIdOrCodepointIndex;And then there's a big warning in the code:
!!! WARNING !!!
When using the context API, UserIdOrCodepointIndex will _always_ be a
codepoint index. To get your original user ID, you need to do:
kbts_shape_codepoint ShapeCodepoint;
kbts_ShapeGetShapeCodepoint(Context, Glyph->UserIdOrCodepointIndex, &ShapeCodepoint);
int MyUserId = ShapeCodepoint.UserId;Can we just have a field for user IDs (preferably 64-wide) and another field for whatever the library does according its increment mode? Just write down the user ID verbatim when it is passed to get it back later.
Activity
2It's just very confusing why those are mixed in the first place and then so much effort spent on the warnings and untangling methods.
I don't plan on changing the glyph format right now, but I do have a few things I would like to improve/change when I do, the user ID situation being one of them.
Hopefully the current situation is still workable. Do you have any specific use case that really suffers from it?