[HarfBuzz] hb_shape_context_t?

Behdad Esfahbod behdad at behdad.org
Fri May 28 15:40:21 PDT 2010


So, staring at the new feature-setting code from Jonathan and having a
pre-shape "compile" feature in mind, I wonder if we should add a
hb_shape_context_t object and move script, language, and direction (and
unicode callbacks) to it.  They currently live in the buffer.

The reason for this is that currently if we want to pre-compile the feature
list, we also have to pass in the buffer to be able to fetch script, lang, and
direction.  That doesn't appeal to me though since the compiled ruleset is
independent of the buffer contents.  We just happened to stuff those settings
into the buffer because we had no other place.

If I add hb_shape_context_t I want it to be an opaque structure with setters.
 Clients are welcome to create one and cache it.  It won't be refcounted.

Does this sound good to you, Jonathan?  I know you probably prefer a fully
defined type that can be allocated on the stack, but for future extension and
binary compatibility, it makes life much easier to have it opaque.

behdad



More information about the HarfBuzz mailing list