pango_ft2_font_get_kerning()



I have started looking at the creation of a Hebrew module for
ft2, and I started of by copying the basic-ft2 module and trying
to understand it. I am still not sure that we need a special Hebrew
module, i.e. if the fonts we are using have real kerning tables for
connecting the accents (nikud) to the characters. Thus I consider
this module to be some kind of a safetrap that will do the same 
heuristics that I more or less succesfully did for the X module.

But there is something fundemental in the basic-ft2 module, that
doesn't look correct to me. In set_glyph(), the following call is
being made:

      glyphs->glyphs[i-1].geometry.width +=
	pango_ft2_font_get_kerning (font,
				    glyphs->glyphs[i-1].glyph,
				    glyphs->glyphs[i].glyph);

This is ignoring the cluster structure all together! E.g. consider 
the following sequence of characters in a hypothetical language:

     A ` , V 

where ` and , are considered accents that will be placed above and
below A respectively. It seems that the following kerning pairs should
be asked for:

    A <=> `         For placing accent ` on top of A.
    A <=> ,         For placing accent , below A.
    A <=> V         For placing A next to V.

That is, a kerning pair should be between the cluster base character
and the accents, or between a cluster base character and the previous
cluster base character. 

I will implement this logic in the Hebrew module, but the question is
if it shouldn't be put in the Basic module a well.

Regards,
Dov



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]