Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hb_buffer_get_glyph_positions can return NULL
During shaping tracing before applying GPOS (at least in HarfBuzz 2.8.2).
- Loading branch information
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite happy with this, as it's a breaking change. I wonder if uharfbuzz did something wrong before? Did the behavior of
hb_buffer_get_glyph_positions
really change in HB 2.8.2? Sounds like it may be a breaking change for HB itself, too, no? @behdad?9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is a deliberate change. This happens only during tracing though, which I don't think is widely used.
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some production code that I'll likely have to adapt, but I may be the only one :)
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simulate the old behavior if you feel the change is too much. Here is the relevant commit, check to see if you prefer to adapt to the new behavior harfbuzz/harfbuzz@c61ce96
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, after reading the discussion before that I think I have more reworking to anyway, so let's just stick with this.
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change only affects message funcs. Since those are not really used in production, I was comfortable releasing this.
If your code crashes now, then it was wrong before. Because calling
hb_buffer_get_glyph_positions()
would clear the position buffer; if buffer didn't have positions yet, you were supposed to NOT call this function. If you did, it was clearing data that was needed for proper substitution.By making this change, we do not let you accidentally shoot yourself in the foot.
9988e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the further explanation! All good.