On Sep 17, 2007 12:37 PM, Behdad Esfahbod &lt;<a href="mailto:behdad@behdad.org">behdad@behdad.org</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
cairo_public void<br>cairo_show_text_glyphs (cairo_t &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*cr,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *utf8,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; utf8_len,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const cairo_glyph_t &nbsp; &nbsp; &nbsp; &nbsp;*glyphs,
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_glyphs,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const cairo_text_cluster_t *clusters,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_clusters,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cairo_bool_t &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;backward);
</blockquote><div><br>It would be useful to have an API to detect whether a surface can make use of this extra information, because there&#39;s a cost to building &#39;utf8&#39; and &#39;clusters&#39;, and this is performance critical code so we&#39;d want to avoid that cost when the information will not be used (which will be the vasty majority of the time...). 
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&nbsp;&nbsp; There is nothing preventing a library generating<br> &nbsp; &nbsp;glyphs that have a negative advance width and so go in the
<br> &nbsp; &nbsp;logical order for right-to-left text, but it&#39;s not common<br> &nbsp; &nbsp;practice and most probably not very well supported.</blockquote><div><br>If I understand you correctly, Gecko does this. For RTL runs we&#39;re calling cairo_show_glyphs with a glyph array whose x-offsets decrease along the array. I think this is technically necessary for CSS compliance since CSS says that all other things being equal, content later in a document (
i.e. in logical order) is higher in z-order than content earlier in the document. <br></div><br>Rob<br></div>-- <br>&quot;Two men owed money to a certain moneylender. One owed him five hundred denarii, and the other fifty. Neither of them had the money to pay him back, so he canceled the debts of both. Now which of them will love him more?&quot; Simon replied, &quot;I suppose the one who had the bigger debt canceled.&quot; &quot;You have judged correctly,&quot; Jesus said. [Luke 7:41-43]