GNOME Bugzilla – Bug 676413
Text to Path cuts off without covering the whole layer
Last modified: 2014-07-08 17:42:56 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.)
I can't reproduce this - does this depend on any special settings or coincidences in this image?
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.
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).
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)?
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)
Had similar problems with cairo 1.12.2, downgrading cairo to 1.10.2 helped me too.
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.
How the heck did you figure that again :) I guess we should ask somebody from cairo to verify that.
#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.
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.
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
No objection :)
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.
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?
The fix will be in 2.8.4, which will be released when it will be released :)
This bug is not about text along path btw, it's about text *to* path.
*** Bug 690192 has been marked as a duplicate of this bug. ***
*** Bug 690651 has been marked as a duplicate of this bug. ***
*** Bug 693100 has been marked as a duplicate of this bug. ***
*** Bug 706602 has been marked as a duplicate of this bug. ***
*** Bug 732913 has been marked as a duplicate of this bug. ***