<div dir="ltr"><div>I only use get/set_user_data() in a single place, where it is impossible to pass some modifiers anyhow else:</div><div><br></div><div>{code}</div><div>static hb_user_data_key_t _useDesignMetricsKey;<br>

</div>void hb_qt_font_set_use_design_metrics(hb_font_t *font, uint value) { hb_font_set_user_data(font, &_useDesignMetricsKey, (void *)quintptr(value), NULL, true); }<br><div>uint hb_qt_font_get_use_design_metrics(hb_font_t *font) { return quintptr(hb_font_get_user_data(font, &_useDesignMetricsKey)); }<br>

</div><div>static hb_position_t _hb_qt_font_get_glyph_h_advance(hb_font_t *font, void *font_data, hb_codepoint_t glyph, void * /*user_data*/)<br>{<br>    QFontEngine *fe = (QFontEngine *)font_data;</div><div>    ...<br>    fe->recalcAdvances(&g, QFontEngine::ShaperFlags(hb_qt_font_get_use_design_metrics(font)));<br>

{/code}</div><div><br></div><div>However, I find the get/set_user_data() API somewhat inconvenient (mostly due to key restrictions) and would love a proper solution for the issue solved here with a useDesignMetrics flag (the issue was described in another thread).</div>

<div>Except of that, I don't think this API is really that useful.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>Regards,<br>Konstantin</div>
<br><br><div class="gmail_quote">2014-05-20 1:10 GMT+03:00 Behdad Esfahbod <span dir="ltr"><<a href="mailto:behdad@behdad.org" target="_blank">behdad@behdad.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

So, are people actually using the get/set_user_data() methods on HB objects?<br>
I'm thinking about removing them at least for hb_blob_t, as part of<br>
streamlining blobs and making them more lightweight.  But if no one uses the<br>
get/set_user_data(), I may as well just remove them all.<br>
<br>
Initially I added these because (based on cairo experience) I was under the<br>
impression that they are extremely useful for language bindings.  However,<br>
they are only if one is willing to write manual bindings, which is something I<br>
prefer to avoid.<br>
<br>
So, if no existing user of HarfBuzz uses them, I think it's a good indication<br>
that they were overkill design artifacts and I'll remove before 1.0.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
behdad<br>
<a href="http://behdad.org/" target="_blank">http://behdad.org/</a><br>
_______________________________________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org">HarfBuzz@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/harfbuzz" target="_blank">http://lists.freedesktop.org/mailman/listinfo/harfbuzz</a><br>
</font></span></blockquote></div><br></div>