/** Gets the kerning between two Unicode characters. The characters
* are converted to names and this names are used to find the kerning
* pairs in the <CODE>Hashtable</CODE> <CODE>KernPairs</CODE>.
* @param char1 the first char
* @param char2 the second char
* @return the kerning to be applied
*/
public override int GetKerning(int char1, int char2)
{
string first = GlyphList.UnicodeToName((int)char1);
if (first == null)
{
return(0);
}
string second = GlyphList.UnicodeToName((int)char2);
if (second == null)
{
return(0);
}
Object[] obj = (Object[])KernPairs[first];
if (obj == null)
{
return(0);
}
for (int k = 0; k < obj.Length; k += 2)
{
if (second.Equals(obj[k]))
{
return((int)obj[k + 1]);
}
}
return(0);
}