After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676413 - Text to Path cuts off without covering the whole layer
Text to Path cuts off without covering the whole layer
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.8.0
Other All
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 690192 690651 693100 706602 732913 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-05-20 08:40 UTC by Brian Marshall
Modified: 2014-07-08 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot showing the bug (41.29 KB, image/png)
2012-05-20 08:40 UTC, Brian Marshall
  Details
quick hack (1.17 KB, patch)
2012-10-27 16:11 UTC, Massimo
none Details | Review
proposed patch (1.25 KB, patch)
2012-10-29 17:15 UTC, Massimo
none Details | Review

Description Brian Marshall 2012-05-20 08:40:57 UTC
Created attachment 214480 [details]
Screenshot showing the bug

The Layers -> Text to Path function doesn't seem to be able to convert entire text layers to a path, unless they're very short. Otherwise, it just stops after a certain point and leaves the rest of the text layer without a path.

Steps to reproduce:

1) Create a new, blank image
2) Use the text tool to type some text. I used "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
3) Go to Layers -> Text to Path (or right click the layer in the Layers toolbox)
4) Switch to the Paths toolbox and make the newly created path visible

Result: The path only covers "Lorem ipsum dolor s" - everything after that is not part of the path.

Expected result: All the text in the text layer should be in the path.

Oddly, this applies separately to each line of a text layer. It seems to be some kind of vertical cutoff as opposed to a character limit. I've attached a screenshot showing that issue. (The paths are in blue/red.)
Comment 1 Michael Schumacher 2012-05-20 21:44:41 UTC
I can't reproduce this - does this depend on any special settings or coincidences in this image?
Comment 2 Brian Marshall 2012-05-21 04:30:57 UTC
Hmm, I don't think it does. I deleted my ~/.gimp-2.8 folder, opened GIMP, went to File -> New, then clicked OK (without changing any settings). I didn't add or change anything with the image itself or any general GIMP settings.

I'm using Debian testing/unstable - could it be a distro/library issue? (I can report it to Debian if so.) Let me know if there's any more info I can provide.
Comment 3 Michael Schumacher 2012-05-21 08:50:03 UTC
GIMP uses the Cairo backend of Pango to create the vectors for the text (see http://git.gnome.org/browse/gimp/tree/app/text/gimptext-vectors.c?h=gimp-2-8 for detailes).
Comment 4 Brian Marshall 2012-05-22 09:13:18 UTC
Well, I'm using libcairo2 1.12.2 and libpango1.0-0 1.30.0, but I'm not sure how useful that is. Are there any variables I can inspect with gdb, like maybe the dimensions that GIMP is allocating for the path (which could explain why it gets cut off on the x-axis)?
Comment 5 Massimo 2012-05-23 15:41:51 UTC
Confirming:

In a text layer, after typing

012345678901234567890

Depending on the font size, only the path of the first
16 (or 17)/21 digits is produced when invoking

Layer->Text to Path.

But it is apparently a problem of cairo from git because it works 
normally if I run gimp preloading libcairo from /usr/lib64

LC_ALL=C LD_PRELOAD=/usr/lib64/libcairo.so gimp-2.8 -v
GNU Image Manipulation Program version 2.8.1
git-describe: GIMP_2_8_0-67-ga4fb969

using GEGL version 0.2.1 (compiled against version 0.2.1)
using GLib version 2.33.1 (compiled against version 2.33.1)
using GdkPixbuf version 2.26.2 (compiled against version 2.26.2)
using GTK+ version 2.24.11 (compiled against version 2.24.11)
using Pango version 1.30.0 (compiled against version 1.30.0)
using Fontconfig version 2.8.0 (compiled against version 2.8.0)
using Cairo version 1.10.2 (compiled against version 1.12.3)
Comment 6 Yuri 2012-09-25 17:26:41 UTC
Had similar problems with cairo 1.12.2, downgrading cairo to 1.10.2 helped me too.
Comment 7 Massimo 2012-10-27 16:11:38 UTC
Created attachment 227406 [details] [review]
quick hack

This is a quick hack that seems compatible with both
cairo-1.10.2 and master. Don't know if it is future
compatible though.

Basically it avoids allocating uselessly a huge surface
and at the same time does not suffer of any clipping.

Better if cairo documented the proper way to extract text-vector
info.
Comment 8 Michael Natterer 2012-10-27 18:26:03 UTC
How the heck did you figure that again :) I guess we should ask somebody
from cairo to verify that.
Comment 9 Michael Natterer 2012-10-27 19:26:07 UTC
#cairo on freenode says that this call will create the surface's
data anyway, and they suggest to use cairo_recording_surface_create(NULL)
instead.
Comment 10 Michael Natterer 2012-10-27 19:39:49 UTC
See http://cgit.freedesktop.org/cairo/tree/src/cairo-gstate.c#n2147

We definitely have to use a surface that has no bounds for this.

It's totally unclear btw how this could ever work, because this is
the commit:

http://cgit.freedesktop.org/cairo/commit/?id=a30209402c7160af257e1ea027e9e2cdab5b5aec

and it was in cairo 1.8 already.
Comment 11 Massimo 2012-10-29 17:15:33 UTC
Created attachment 227566 [details] [review]
proposed patch

Ok, cairo_recording_surface_create (CAIRO_CONTENT_ALPHA, NULL)
works correctly with both versions.

Unless someone objects, I'll push the attached patch
Comment 12 Michael Natterer 2012-10-29 18:13:37 UTC
No objection :)
Comment 13 Massimo 2012-10-30 17:14:00 UTC
fixed in master and gimp-2-8:

commit b25f9abedfec6d7c70f0b4b85a81799539ab73e8
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date:   Tue Oct 30 18:07:07 2012 +0100

    Bug 676413: Text to Path cuts off without covering the whole layer
    
    Use an unbounded cairo_recording_surface to extract a
    cairo_path_t from a pango_layout.
Comment 14 cormac 2012-11-07 22:15:28 UTC
Upgrade from Ubuntu 12.04 to 12.10 automatically upgraded GIMP to 2.8.2. "Text Along Path" no longer works. The above fix didn't work for me. Any ideas when an update will be rolled out?
Comment 15 Michael Natterer 2012-11-07 22:28:24 UTC
The fix will be in 2.8.4, which will be released when it will be released :)
Comment 16 Michael Natterer 2012-11-07 22:28:51 UTC
This bug is not about text along path btw, it's about text *to* path.
Comment 17 Michael Natterer 2012-12-14 08:15:07 UTC
*** Bug 690192 has been marked as a duplicate of this bug. ***
Comment 18 Michael Schumacher 2012-12-22 21:37:41 UTC
*** Bug 690651 has been marked as a duplicate of this bug. ***
Comment 19 Dimitri Robert 2013-02-03 18:01:53 UTC
*** Bug 693100 has been marked as a duplicate of this bug. ***
Comment 20 Michael Schumacher 2013-08-22 18:21:07 UTC
*** Bug 706602 has been marked as a duplicate of this bug. ***
Comment 21 eng442 2014-07-08 17:42:56 UTC
*** Bug 732913 has been marked as a duplicate of this bug. ***