On Sep 17, 2007 12:37 PM, Behdad Esfahbod <<a href="mailto:behdad@behdad.org">behdad@behdad.org</a>> 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 *cr,<br> const char *utf8,<br> int utf8_len,<br> const cairo_glyph_t *glyphs,
<br> int num_glyphs,<br> const cairo_text_cluster_t *clusters,<br> int num_clusters,<br> cairo_bool_t 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's a cost to building 'utf8' and 'clusters', and this is performance critical code so we'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;"> There is nothing preventing a library generating<br> glyphs that have a negative advance width and so go in the
<br> logical order for right-to-left text, but it's not common<br> practice and most probably not very well supported.</blockquote><div><br>If I understand you correctly, Gecko does this. For RTL runs we'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>"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?" Simon replied, "I suppose the one who had the bigger debt canceled." "You have judged correctly," Jesus said. [Luke 7:41-43]