[HarfBuzz] HarfBuzz for Indic scripts

Behdad Esfahbod behdad at behdad.org
Tue Sep 30 12:46:53 PDT 2008

Peter Hunter wrote:
> I've been charged by my company with implementing a module to handle Indic languages in our typesetting system and I've been exploring the use of HarfBuzz to do that
> Currently I've created interfaces between HarfBuzz library and ICU and Freetype and a trivial test program
> If anyone's interested I can supply them as potential sample (and basic) usages
> But I have a couple of questions
> (1)The character metrics have a height,width,x,y,xoffset and yoffset
> The height and width I'm comfortable width, but can anyone explain the x,y and  xoffset,yoffset pairs
> I'm guessing that one of x,xoffset might be the leading side bearing and y,yoffset might be starting position relative to the baseline. But I'd appreciate actually knowing what they are

Assuming that you are talking about the shaping API, I don't know that code.
But you can read the code to figure out what's going on!

> (2)The font I'm testing with doesn't appear to include much in the way of GPOS information, is there any way of defaulting the actions of the code so that vowel signs are correctly positioned. (In our current typesetting system if no combined character exists for accented characters then we position the accent over the midpoint of the character)

I know the shaper in HarfBuzz does some of that if you provide it with the
mark attachment type information.

> (3)Perhaps it's the way I'm calling the library, but I had a memory access problem in HARFBUZZ-SHAPER.CPP :: HB_OpenTypePosition where it does
> memset(face->buffer->positions, 0, face->buffer->in_length*sizeof(HB_PositionRec));
> immediately before
>          glyphs_positioned = HB_GPOS_Apply_String(item->font, face->gpos, face->current_flags, face->buffer, false, false) != HB_Err_Not_Covered;
> The problem was that face->buffer->positions was zero, but I did notice that HB_GPOS_Apply_String calls
> _hb_buffer_clear_positions( buffer ) which allocates and clears the buffer->positions array
> Does this mean that the memset(...) is redundant and could be removed

Quite possible.  I added the _clear_positions stuff much after the shaper was
added.  Feel free to submit a tested patch and I'll push.

> (4) Not so much of a problem, but we're a windows shop and neither I nor one of my associates were able to access the sources using GIT GUI or GitBash. Perhaps there's a firewall problem at this end. Is anyone aware of a similar problem

None that I heard of.

> Thanks for such a readily usable product

Oh wow, I never thought someone will call the current state of HarfBuzz
readily usable :).

> Peter Hunter



More information about the HarfBuzz mailing list