Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Overlapping Paths
#11
Making progress... Not totally fit for human consumption yet.

   

And my current algorithm doesn't work with the dotted zero above.
Reply
#12
Fantastic!

It will be a huge win to have this functionality in gimp after all these years.
Reply
#13
Hmmm. Having more questions than answers right now.
  • Techniques that do a single mask of outlines and a single mask of holes don't work in cases where there is an outline inside a hole, for instance the dotted zero shown above, or a nearby character that overlaps the hole in another.
  • Processing strokes in sequence (adding outlines, removing holes) would at least work for the dotted zero case, but not for the overlap if the overlapping character appears first (which is unfortunately the more frequent case)
  • A bit of experimenting shows that when you edit a stroke if goes to the end of the strokes list, so it can solve the overlap issue (the overlapping character is drawn last), however this applies to the stroke and not to the character, so if the character has holes, the holes are going to be drawn out of sequence and will be filled when the outline stroke is eventually drawn. So the sequencing algorithm is not very robust with an edited path (not speaking of strokes where the orientation gets changed by the editing).
The conclusion is that whatever I do, the doc for all the caveats, pitfalls and restrictions if going to take longer to write than the code. I just hope that some people will read it.
Reply
#14
By the way, in your workflow when you transfer the path back from Inkscape, the problem is that the position of holes gets wrong somewhere in along the way. So did you try to export as SVG from Inkscape and import the file in Gimp instead? If the technique works then you are more or less sorted, and if the problem persists the SVG is a smoking gun: if the coordinates are incorrect it's Inkscape's fault, otherwise it's Gimp's.
Reply
#15
(05-10-2020, 08:51 AM)Ofnuts Wrote: So did you try to export as SVG from Inkscape and import the file in Gimp instead? If the technique works then you are more or less sorted

This method does work. Details as follows:

Open akovia’s Path-Overlap.xcf file (which is 800x310 px)

Export the “Path” path as PathOverlap1.svg

Open PathOverlap1.svg in Inkscape. Set units to px. It is now 1067x413 px !

In Inkscape, do Path > Union

In Inkscape, Save As PathOverlap2.svg

In Gimp, Open PathOverlap2.svg. (That is opening this svg as a new image) In the dialogue, set W & H to 800 & 310. Check “Import paths”

This new image has a path called “Path”. Drag this path to the original  Path-Overlap.xcf


Attached Files Thumbnail(s)
   
Reply
#16
This certainly sounds incredibly difficult. Maybe this is the reason it hasn't been added to gimp yet over the years.

I will certainly read the EULA, Big Grin  but maybe this will end up being a first try scenario and hope for the best before brandishing Inkscape. As Blightly pointed out, Inkscape works fine if you go through all the exporting/importing instead of the much easier copy/paste, but it does work.

I appreciate all the work in trying to untangle this thing. I just wish I had some better input to support your effort.
Reply
#17
Roping you in: can you create an XCF with paths obtained from text using both frequently used and baroque fonts from your catalog. Text should be some decent size (100px). You can also include some trick paths that you edited. If there is nothing but paths and text layers (though these aren't strictly required) the XCF should be small.
Reply
#18
Taking strokes sequence and adding/subtracting them from the selection depending on orientation seems to work quite well, this even handles the dotted zero case.

   
Reply
#19
(05-10-2020, 08:25 PM)Ofnuts Wrote: Roping you in: can you create an XCF with paths obtained from text using both frequently used and baroque fonts from your catalog. Text should be some decent size (100px). You can also include some trick paths that you edited. If there is nothing but paths and text layers (though these aren't strictly required) the XCF should be small.

The results so far are looking fantastic!

I left the ones that overlap naturally alone, and squished the others. Let me know if you need any of these fonts for testing and I'll send them directly instead of posting here.

   


Attached Files
.xcf   text-paths.xcf (Size: 1.02 MB / Downloads: 207)
Reply
#20
Preliminary results aren't too bad, even if not perfect...

   

Differences highlighted:

   

So:
  • Could have been worse
  • I wonder what is the deal with the leading "A" of the "Adobe Calson Pro" and "American Typewriter"
  • I'll have to investigate the holes in "Anabelle" and "Arnold"
  • Some cases where overlapping characters aren't done right.
    • The "oe" in "Boecklin"
    • Some minor instances in "American Typewriter", "Anabelle" and "LED board"
  • Had an error with "LED board": although the script is reasonably fast, that one has 400 strokes (20-40 on others). I tried to bucket-fill the selection
    before he script was done so I am missing things.

I'll see how much of this is fixable by tiinkering the path.
Reply


Forum Jump: