On 10/22/07, <b class="gmail_sendername">Robert O&#39;Callahan</b> &lt;<a href="mailto:robert@ocallahan.org">robert@ocallahan.org</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<span class="q">On Oct 23, 2007 11:21 AM, Behdad Esfahbod &lt;<a href="mailto:behdad@behdad.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">behdad@behdad.org</a>&gt; wrote:<br></span><div class="gmail_quote">
<span class="q"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;There is nothing preventing a library generating<br><div>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;glyphs that have a negative advance width and so go in the<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;logical order for right-to-left text, but it&#39;s not common
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;practice and most probably not very well supported.<br>&gt;<br>&gt; If I understand you correctly, Gecko does this. For RTL runs we&#39;re<br>&gt; calling cairo_show_glyphs with a glyph array whose x-offsets decrease
<br>&gt; along the array.<br><br></div>You may want to revisit this. &nbsp;It adds lots of overhead both in X and<br>PS/PDF backends as each glyph need to be positioned individually.<br><div></div></blockquote></span><div>
<br>I&#39;ll keep that in mind, thanks.</div></div></blockquote><div><br>Alternatively, I was thinking that maybe the cairo backends can be &quot;fixed&quot;.&nbsp; The idea is: ignore glyph width returned by font backend.&nbsp; Just use whatever that makes the first use of each glyph use *natural* width.&nbsp; That is, use (glyph[i+1].x - glyph[i].x) as natural width of glyph[i].index.&nbsp; However, while this may improve positioning for regular LtR runs, it doesn&#39;t work for RtL unless you put the glyph origin at the right of the glyph too, otherwise you&#39;ll be using the width of next glyph as in case of RtL, (glyph[i+1].x - glyph[i].x) is equal to -width(glyph[i+1].index).
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><span class="q"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>&gt; I think this is technically necessary for CSS compliance since CSS
<br>&gt; says that all other things being equal, content later in a document<br>&gt; ( i.e. in logical order) is higher in z-order than content earlier in<br>&gt; the document.<br><br></div>Humm, not sure if it&#39;s necessary. &nbsp;Basically the order of glyphs in a
<br>single show_glyph() call should be irrelevant to the output. &nbsp;Any weird<br>combinations of operators and sources that violate that assumption?</blockquote></span><div><br>You may be right. But possibly with (future) user fonts where glyphs can have different colours? Sounds like a fragile assumption in general when you consider all possible backends etc.
</div></div></blockquote><div><br>Ok.&nbsp; I need to rethink the proposed API to see if we need to take this into consideration.&nbsp; It may just work, donno.&nbsp; Need to also check how PDF viewers deal with such text runs.<br><br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>Rob<br></div></div><div><span class="e" id="q_115c9ddac850e599_6">
-- <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]
</span></div></blockquote></div><br>-- <br>behdad<br><a href="http://behdad.org/">http://behdad.org/</a>