[HarfBuzz] A couple of clarifications regarding HarfBuzz

Tom Hacohen tom.hacohen at partner.samsung.com
Thu Oct 21 01:10:50 PDT 2010


Hi Behdad,

Thanks a lot for your response, my comments are below:

On Wed, 2010-10-20 at 20:17 -0400, Behdad Esfahbod wrote:
> Yes, that's it.  It's more than plain reversal at the end though.  You get the
> direction from the output of UAX#9 (eg. FriBidi).
What does it do more than a plain reversal? And yes, I got the direction
from FriBiDi.
> 
> Language is used to do language-specific adjustments when appropriate.  You
> typically just pass the locale or whatever your higher-level tells you (think
> of lang attribute in html) to hb_language_from_string.
As I thought, thanks, I wasn't thinking about languages using the same
script like many of the latin languages and their ligatures.

> 
> Some of the fallbacks and specific details wouldn't work.  For example,
> mirroring would not work, which means that you would get incorrect result when
> brackets are used in Arabic.
> 
> Also, Jonathan Kew has some code in Firefox to implement those.  You may want
> to check them out.
Thank you very much, I will.

> 
> HarfBuzz does the right thing no matter what you pass in.   So you can safely
> pass 0.  String length in characters would be most appropriate if you have it.
I assumed HarfBuzz does well anyway, but I want the fastest way
possible. Ok then, I have the string's length (as it's needed for
buffer_add anyway).

> Those are OpenType features.  You can ignore them for now I would say.
Thank you very much.

> The output glyphs have a member called ->cluster, which points to the start
> index of the cluster a glyph is part of.
Oh, very nice, thanks.

> The low-level API to fetch that information from GDEF is available through
> hb_ot_layout_get_lig_carets(), however, very few fonts provide such
> information.  It's common to just divide the width by the number of graphemes.
graphemes being non diacritic glyphs?

Thanks a lot,
Tom.




More information about the HarfBuzz mailing list