Re: pango_ft2_font_get_kerning()



dov imagic weizmann ac il writes:

> 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.

Do you know if "commonly available" TTF/PS Hebrew fonts have the
appropriate kerning tables?
 
> 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.

Yes, I think such logic it should be in the Basic module as well.

In some cases, accents actually can interact, at which point you
need more than simply accent <=> base kerning pairs. I think OpenType
does support this sort of more complicated accent attachment (as
well as extra kerning types like attachments to control points),
but we can worry about that when we actually have fonts using 
these features.

Regards,
                                        Owen



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