<div>
Thanks. I could manage to do this by using ucdn_get_script() for now. BiDi is going to be the next big challenge.
</div>
<div><div><br></div><div>-- </div><div><p style="margin: 0px; font-size: 12px; font-family: 'Trebuchet MS'; color: rgb(35, 35, 35); "><b>Lóránt Pintér</b></p>
<p style="margin: 0px; font-size: 12px; font-family: 'Trebuchet MS'; color: rgb(35, 35, 35); ">Developer at <a href="http://prezi.com"><span style="color: rgb(18, 85, 204); ">Prezi</span></a></p></div></div>
<p style="color: #A0A0A8;">On Sunday, April 7, 2013 at 1:55 PM, Khaled Hosny wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div>On Sun, Apr 07, 2013 at 02:59:32AM +0200, Lóránt Pintér wrote:</div><blockquote type="cite"><div><div>Hi, </div><div><br></div><div>I'm struggling with the problem of shaping mixed text. Say I have Thai</div><div>and English text that I would like to shape. If I put all of it in a</div><div>buffer, HarfBuzz chooses a shaper based on the first identifiable</div><div>character, and then uses that shaper for the whole text. So</div><div>"<thai><english>" gets shaped fine with the Thai shaper, but</div><div>"<english><thai>" gets messed up because it is shaped with the default</div><div>shaper.</div><div><br></div><div>I was trying to figure out how Pango does this, but found nothing yet.</div><div><br></div><div>Is it possible to ask HarfBuzz to identify text runs inside a buffer</div><div>(or some other way) that can be shaped with different shapers? If</div><div>there was a call that would identify the script (and maybe writing</div><div>direction) of each character in the input, then I could split the</div><div>buffer at positions where these a different script is used.</div></div></blockquote><div><br></div><div>You have to split the text runs before passing them to HarfBuzz, etch</div><div>run should have the same script/language and text direction.</div><div><br></div><div>Ideally text should be first itemized into runs with the same script,</div><div>and further split them into directional run according to BiDi algorithm.</div><div><br></div><div>There are of course more subtleties involved, like when using multiple</div><div>fonts etc.</div><div><br></div><div>Regards,</div><div>Khaled</div></div></div></span>
</blockquote>
<div>
<br>
</div>