-
Notifications
You must be signed in to change notification settings - Fork 13
Add tracing messages #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add tracing messages #280
Conversation
|
Clippy fails are not my fails. |
This is unfortunate (and I think it's what's causing the clippy failures). Behdad and I have discussed dropping the type state pattern around the buffer and just exposing a single |
|
This would be great to have. +1 to removing the extra types. |
|
The wrapper types are quite helpful though, for avoiding confusion about what kind of buffer you've got. Another approach would be to add a couple of TryInto traits. |
|
Argh, yes, this isn't going to work because the client can't current do anything with the |
|
Oh, another problem. Even if we do make a buffer available to the client, we can currently only pass simple functions. If we want to pass mutable closures ( |
|
Making them static, consumers can do evil things with |
|
This is so cool! I can even hook it up in |
|
I feel like this ought to be feature flagged so that it completely compiles out when not in use. Skimming through this PR, this probably wouldn't be that hard to do? |
|
Agree but first we need a steer from Behdad and Chad about what to do with buffer types. My preference is for the messages to actually return an enum of GlyphBuffer and UnicodeBuffer. (And add getters to UnicodeBuffer.) But unifying the types is also an option. |
|
That's up to Chad. I prefer a single-type solution closer to HB. |
This ports the Harfbuzz tracing messages protocol to Harfrust.
Because all the internal shaping guts deal in
hb_buffer_ts, we pass ahb_buffer_tto the callback function. In a prefect world, the user would receive aUnicodeBufferorGlyphBufferdepending on what stage of shaping we're at, but that requires something like wrapping the heterogenous types in an enum so that either kind of buffer can be passed to the same callback function, which is boring, and annotating every call tomessage!with what kind of buffer to return, which is intrusive.So while this implementation is mildly inconvenient, I'm relying on the fact that the kind of person who is doing stuff with a messaging function is the kind of person who will be able to handle raw
hb_buffer_ttypes (including, unfortunately, having to handle serialization themselves).