[HarfBuzz] patch to add getters for gr_font and gr_face

Behdad Esfahbod behdad at behdad.org
Sun Dec 9 16:40:48 PST 2012


On 12-12-09 07:25 PM, Khaled Hosny wrote:
> On Sun, Dec 09, 2012 at 06:49:08PM -0500, Behdad Esfahbod wrote:
>> On 12-12-09 04:34 AM, Khaled Hosny wrote:
>>> On Sat, Dec 08, 2012 at 12:41:01AM +0700, Martin Hosken wrote:
>>>> Dear Behdad,
>>>>
>>>> Khaled says he needs this for xetex. I enclose a patch to add getter
>>>> functions to hb-graphite2 for gr_font and gr_face. No idea if the work
>>>> though ;)
>>>
>>> Thanks Martin, this seems to work for my need (hb-graphite2.h is missing
>>> a graphite2/Font.h include, though), I was hoping it would return
>>> Graphite face/font only if graphite2 shaper is actually used, but it is
>>> not a big deal for XeTeX use case.
>>
>> The way you are supposed to use the API for something like that is to create a
>> shape_plan first, and use hb_shape_plan_get_shaper() and strcmp to "graphite2".
>>
>> I pushed out the new API now.  Looks to me like it should indeed only return
>> non-NULL in cases that graphite2 backend will be used by default, though I've
>> not tested those.  The API is a bit different from what Martin provided.
> 
> It returns non-NULL if the font have Graphite tables even if only ot
> shaper is requested with hn_shape_full(). I’ll check the shape_plan API.

Indeed.  The has no way to know what you are passing to hb_shape_full() ;).
In general, in something like XeTeX, it probably makes sense to use the
shape_plan API directly.

b

> Regards,
> Khaled
> 

-- 
behdad
http://behdad.org/



More information about the HarfBuzz mailing list