[HarfBuzz] Using FreeType load flags

Nikolay Sivov bunglehead at gmail.com
Fri Aug 28 06:52:17 PDT 2015


On 28.08.2015 14:41, Jamie Dale wrote:
>
>>
>> We don't handle any load_flags.  That definitely has API implications. :(
>>
>> FreeType works in 26.6 mode.  Clients can decide to use that mode, and everything
>> would work fine.  However, we also abuse this API for performing in font-space,
>> but don't pass the correct flags to FreeType.  We just abuse the no-hinting
>> mode for that, such that no rounding etc happens.  As such, we don't set ppem, and
>> pass NO_HINTING around.  This seems to work best, until we go ahead and add a full load_flags API.
>>
>
> I was wondering what, if any, issues you might expect to see if I
> change the load flags to include hinting methods, and also whether you
> had any suggestions for how to work around those issues (ideally
> without having to change HarfBuzz itself - we like to keep our third
> party dependencies vanilla where possible as it makes them easier to
> upgrade in the future).

That's a good question and I'm interested in answer too. My other 
concern is bold/oblique simulations. Now in our project we force 
NO_BITMAP every time we have simulations, so we can apply oblique 
transform or make outline heavier (or both). In that case bitmap metrics 
are obviously ignored and we also have to fix up advances and extents a 
little to account for increased glyph weight. I don't see an obvious way 
to fix that, maybe such faces are considered worthless from shaping 
point of view, I don't know.

The fact that harfbuzz doesn't call anything to set font ppem I can see 
as a feature, because (if I got it right from FT docs) when FT_Face is 
created using FT cache system you're not supposed to apply any scaling 
to it.

Now looking at hb-ft.cc, I'm a bit concerned about FT_Load_Glyph called 
over and over again. Does it cache intermediate results per glyph? E.g. 
are methods using FT_Load_Glyph called for same glyph sequentially or is 
it possible it wants advances for every glyph, then extents, then 
origins without caching anything in between?

>
> Thanks,
> Jamie.
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>



More information about the HarfBuzz mailing list