On 4/23/05, <b class="gmail_sendername">Owen Taylor</b> <<a href="mailto:otaylor@redhat.com">otaylor@redhat.com</a>> 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;">
Leaving that question aside, I really think you should be pixel<br>snapping coordinates before calling Cairo in what you've shown there...<br><br>(I don't really mean to just round the coordinates immediately before<br>calling Pango, I mean to chose coordinates that are properly pixel
<br>aligned. E.g., if you ask Pango for the underline thickness it always<br>gives you an integer value when font hinting is on ... so you don't<br>get the smeary underline in your screenshot)</blockquote><div><br>
(Actually I think the underline in the screenshot is exactly 1px high.
I think the problem is that some font-height isn't snapped to an
integral number of pixels so the underline spans two pixel rows. But
that doesn't detract from your main point...)<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;">Turning off antialiasing either is going to cause a huge performance<br>hit (for FSAA)
</blockquote><div><br>
Though we'll probably need FSAA anyway to deal with the adjoining edges problem.<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;"> or going to lose antialiasing.</blockquote><div><br>
That would be OK too since we currently don't have it. And if we pixel-snapped everything we wouldn't be using it anyway!<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;">Now, maybe you could<br>only antialias some things and not others, but in general, if you
<br>could make that determination easily, you could pixel snap edges<br>easily.</blockquote><div><br>
We discussed this before and I still don't agree :-). Here are my current thoughts.<br>
<a href="http://wiki.mozilla.org/Mozilla2:Antialiasing">http://wiki.mozilla.org/Mozilla2:Antialiasing</a><br>
You're welcome to edit. My issues with the pixel-snapping approach are here:<br>
<ul>
<li> It means that layout of a page inherently depends on device
resolution; we'd like layout to be as device-independent as possible.
</li><li> It is probably not correct according to the CSS spec, which
definitely allows for fractional pixel measurements, and does not
explicitly allow for rounding.
</li><li> It will not work if the presentation is scaled or rotated.
</li><li> It's a huge amount of work to implement in our code base.</li>
</ul>
About scaling... we need to be able to zoom in and out with arbitrary scale factors without relaying-out the document.<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;">Also, note that Cairo performance will be *much* better for drawing<br>rectangles if you pixel snap the edges, as of recently, as it can
<br>then use rectangle drawing fast paths.</blockquote><div><br>
If we turn off antialiasing, similar performance benefits should apply.<br>
</div></div><br>Rob<br>-- <br>["Therefore, my dear friends, as you have always obeyed–not only in my<br>presence, but now much more in my absence–continue to work out your<br>salvation with fear and trembling, for it is God who works in you to will
<br>and to act according to his good purpose." Philippians 2:12-13.]