<div dir="ltr"><font color="#674ea7">PSB with comment [UvarajaP]</font>.<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 3:24 PM, Rajeesh K Nambiar <span dir="ltr"><<a href="mailto:rajeeshknambiar@gmail.com" target="_blank">rajeeshknambiar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 11:06 AM, Uvaraja Pandian <span dir="ltr"><<a href="mailto:p.uvaraja@gmail.com" target="_blank">p.uvaraja@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="background-image:initial;background-repeat:initial">Hi  Team,<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">We are using the Harfbuzz 0.9.34 version.<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">While rendering the Malayalam string using the Harfbuzz and Freetype engine, we see some issues.<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>String used: </b><span style="font-family:Kartika,serif">ക്കേ</span><u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>Unicode value:</b> 0x0d15, 0x0d4d, 0x0d15, 0x0d47, 0x0000 <u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>Harfbuzz Output:<u></u><u></u></b></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><img width="123" height="64" src="cid:image001.jpg@01CFCDC3.FEC4C960"><u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>Proper Output :<u></u><u></u></b></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><img width="69" height="45" src="cid:image002.png@01CFCDC3.FEC4C960"><u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>Font File used:</b> Akruti Family, Since this is a licensed font file, we are not able to share it.</p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b>Issue in Detail:<u></u><u></u></b></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">In the font file,<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">script mlym {<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  # Malayalam<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature Akhands;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature BelowBaseSubstitutions;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature <b>HalfForms</b>;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature PostBaseForms;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature PostBaseSubstitutions;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">  feature <b>PreBaseSubstitutions</b>;<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">}<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><u></u> <u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">As per the Harfbuzz implementation, below substitution is happening as part of the HalfForms ,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">0x0d15 & 0x0d4d </span><span style="font-family:Wingdings;color:rgb(149,55,53)">è</span><span style="color:rgb(149,55,53)"> XYZ character,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">so the output is XYZ, 0x0d15, 0x0d47<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">Final re-ordering happens and rearranges as below,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">XYZ, 0x0d15, 0x0d47 </span><span style="font-family:Wingdings;color:rgb(149,55,53)">è</span><span style="color:rgb(149,55,53)"> XYZ, 0x0d47, 0x0d15</span></p></div></blockquote><div><br></div><div>Does final_reordering happen before applying 'pres' lookup?</div></div></div></div></blockquote><div><font color="#674ea7">[UvarajaP] Yes, as per the HARFBUZZ logic in  indic_features[] list, PRES is applied after the final_reordering.</font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)"><u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">As per the PreBaseSubstitutions,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)">XYZ & 0x0d15 is not matched and the output is not proper.</span></p></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(149,55,53)"><u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> </span></p></div></blockquote><div><br></div><div>If the font has a 'pres' rule for XYZ, 0x0D15, the conjunct should form correctly.<br></div></div></div></div></blockquote><div><font color="#674ea7">[UvarajaP]  Font file has a substitution rule for XYZ and 0xOD15 combination. However in  final_reordering() it has changed the order, so it is not able to match the substitution rule. </font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(0,176,80)">In-Order to solve this issue, below changes has been done,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(0,176,80)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(0,176,80)">Final Re-ordering,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)">PSB for the code changes<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(0,176,80)">As per the PreBaseSubstitutions,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(0,176,80)">XYZ & 0x0d15 forms the final character.<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><b><span style="color:rgb(31,73,125)">Code Modifications:<u></u><u></u></span></b></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)">In the file hb-ot-shape-complex-indic.cc, if we modify the lines as below in the function final_reordering_syllable() it is working,<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">  if (start + 1 < end && start < base) /* Otherwise there can't be any pre-base matra characters. */<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">  {<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">          /* If we lost track of base, alas, position before last thingy. */<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">          unsigned int new_pos = base == end ? base - 2 : base - 1;<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">    </span><span style="color:rgb(13,13,13)">/* Malayalam / Tamil do not have "half" forms or explicit virama forms.<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(13,13,13)">     * The glyphs formed by 'half' are Chillus or ligated explicit viramas.<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(13,13,13)">     * We want to position matra after them.<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(13,13,13)">     */<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">          if (buffer->props.script != HB_SCRIPT_MALAYALAM && buffer->props.script != HB_SCRIPT_TAMIL)<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">         {<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                       </span><span style="color:rgb(31,73,125)">…</span><span style="color:rgb(166,166,166)"><u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><s><span style="color:red">          }<u></u><u></u></span></s></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                       if (start < new_pos && info[new_pos].indic_position () != POS_PRE_M)<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                       {<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)">                              …<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                       } else {<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                              </span><span style="color:rgb(31,73,125)">…</span><span style="color:rgb(166,166,166)"><u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">                       }<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166);background:maroon">        }</span><span style="color:rgb(166,166,166)"><u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(166,166,166)">  }<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)">Please comment, will it have any side effect.<u></u><u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial"><span style="color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">Best Regards,<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">Uvaraja P.<u></u><u></u></p><p class="MsoNormal" style="background-image:initial;background-repeat:initial">Sindhura P.</p></div>
<br><br>
<br></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Rajeesh<br></div>
</font></span></div></div>
</blockquote></div><br></div></div>