[cairo-bugs] [Bug 89080] New: cairo truncates font glyphs whose max_x_advance is < bbox width

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Feb 11 00:59:00 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=89080

            Bug ID: 89080
           Summary: cairo truncates font glyphs whose max_x_advance is <
                    bbox width
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: sixtysix at inwind.it
        QA Contact: cairo-bugs at cairographics.org

Created attachment 113342
  --> https://bugs.freedesktop.org/attachment.cgi?id=113342&action=edit
testcase

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

http://cgit.freedesktop.org/cairo/tree/src/cairo-composite-rectangles.c#n439

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:

http://www.dafont.com/theme.php?cat=601

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20150211/3fa71d4e/attachment.html>


More information about the cairo-bugs mailing list