[HarfBuzz] Streamlining hb_font_t some more

Behdad Esfahbod behdad at behdad.org
Fri Oct 2 10:13:45 PDT 2015


On 15-10-02 06:08 PM, Konstantin Ritt wrote:
> Sounds just great!
> 
> 2015-10-02 19:51 GMT+03:00 Behdad Esfahbod <behdad at behdad.org
> <mailto:behdad at behdad.org>>:
> 
>       - Make all fonts have a parent; for fonts created with hb_font_create(),
>     they will default to the hb_font_get_empty() font as their parent.  This
>     changes the return value of hb_font_get_parent() for most fonts, but I don't
>     think any clients rely on that.  The get_parent() for the empty font will
>     continue to return NULL.
> 
> 
> I do not really understand why...

It removes an "if" conditional from the default callbacks, as they can assume
parent is present.


> Do we really want to
>     while (hb_font_get_parent(font) != hb_font_get_empty())
>         font = hb_font_get_parent(font); 
> ?

Really depends on what the client is doing.  If they don't care about
processing get_empty() one, they just do one more iteration to get to NULL.

> Regards,
> Konstantin 

-- 
behdad
http://behdad.org/


More information about the HarfBuzz mailing list