Patterns applied to text objects are blurred

Bug #1005892 reported by dopelover
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

Applying pattern to text objects results in blurred pattern.
The problem affects Inkscape from trunk (revno. 11435).
This seems to be a regression.

Thera are also two files attached to the raport. Source SVG and exported PNG.

Revision history for this message
dopelover (dopelover) wrote :
Revision history for this message
dopelover (dopelover) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Based on tests with archived builds, issues with text objects using a pattern fill started with the merge of the rendering cache branch (10579(:
- builds <= r10577 render the checkerboard pattern fill of the scaled 'flowed text' object in the example file ok
- builds r10581-10618: pattern fails to scale when changing the zoom level
  (scale of the pattern seems to related to screen instead document px)
- build r10620: fails to render text fills at all
  (flat color, gradients, patterns…)
- build r10624 and later revisions: render the pattern fill rasterized
  (like clipped patterns, bug #955141)

Reproduced with latest trunk build (r11435) on OS X 10.5.8 (32bit, with cairo 1.10.2) and OS X 10.7.4 (64bit, with cairo 1.12.2).

tags: added: pattern regression text
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 11649.

Changed in inkscape:
status: Confirmed → Triaged
tags: added: renderer-cairo
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
ScislaC (scislac)
tags: added: blocker
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

As of rev. 12523*, the fill patern scales again properly when changing the zoom-level. This was one of the issues ~suv listed

*: see http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12523?start_revid=12523

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

W.r.t. the blur: it looks like the pattern is created just fine, and that things go wrong when rendering.

There are a few lines in sp-pattern.cpp, which are very useful for verifying this:

    // Uncomment to debug
    // cairo_surface_t* raw = pattern_surface.raw();
    // std::cout << " cairo_surface (sp-pattern): "
    // << " width: " << cairo_image_surface_get_width( raw )
    // << " height: " << cairo_image_surface_get_height( raw )
    // << std::endl;
    // cairo_surface_write_to_png( pattern_surface.raw(), "sp-pattern.png" );

If I activate this, then the generated png (of a single tile in the pattern) is crisp and clear; also, when exporting to pdf you get a crisp image, but when exporting to png the image is blurred

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

The above sample SVG uses Flowed Text. The problem still occurs with normal text. I've added a rewritten test SVG with all the cruft removed.

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

I've located the problem... but don't know exactly how to fix it. If one compares the routines DrawingShape::_renderItem and DrawingText::_renderItem in src/display/drawing-shape.cpp and src/display/drawing-text.cpp respectively, one sees that in the shape version, ct.transform(_ctm) is called before the patterns are created, in the text version it is called after. By calling it before the patterns are created, the patterns are created at the appropriate scale for what ever zoom is being used. Calling after causes the patterns to be created as if the display was at 100% which results in blurring when zoomed in.

One cannot simply move the call to ct.transform(_ctm) in the text version to be before the place where the pattern is created as it then messes up the drawing of the glyphs. I don't know the best way to fix this. I can certainly hack a fix but it would probably be sub-optimal.

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

The issue should be fixed in r12760.
Setting to fix released, since the bug didn't appear in any stable release.

Changed in inkscape:
status: Triaged → Fix Released
su_v (suv-lp)
tags: removed: blocker
su_v (suv-lp)
Changed in inkscape:
milestone: 0.49 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.