<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - cairo truncates font glyphs whose max_x_advance is < bbox width"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=89080">89080</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>cairo truncates font glyphs whose max_x_advance is < bbox width
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sixtysix@inwind.it
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=113342" name="attach_113342" title="testcase">attachment 113342</a> <a href="attachment.cgi?id=113342&action=edit" title="testcase">[details]</a></span>
testcase

In _cairo_composite_rectangles_init_for_glyphs extents->bounded
is intersected with the output of 
_cairo_scaled_font_glyph_approximate_extents

<a href="http://cgit.freedesktop.org/cairo/tree/src/cairo-composite-rectangles.c#n439">http://cgit.freedesktop.org/cairo/tree/src/cairo-composite-rectangles.c#n439</a>

which probably is considered a cheap approximation in excess of
the ink extents. Unfortunately there are fonts for which the
approximation is in defect.

This means that the cheap intersection test can incorrectly fail
and even when there is intersection the output is incorrectly
clipped.

A workaround for the incorrect clip is to swap the arguments
in the call to _cairo_rectangle_intersect so that when there 
is intersection extents->bounded is left unmodified and 
extents->mask is anyway recomputed correctly in the following 
call to _cairo_scaled_font_glyph_device_extents.


This workaround introduces another failure in the test-suite, but
considering test/reference/user-font-mask.ref.png you can see that
the first rows of the ink extent (green) rectangle are white, not
inked at all and the dot of the i is not symmetric, with the
workaround above the dot is symmetric and the ink extents is
corresponding to the 'inked' area.

The attached test case uses the font Mademoiselle Camille
obtained from:

<a href="http://www.dafont.com/theme.php?cat=601">http://www.dafont.com/theme.php?cat=601</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>