When text contains manual kerns, extension/text/split text.. by word fails

Migrated from: https://bugs.launchpad.net/inkscape/+bug/1779703

Steps to reproduce:

  • open Inkscape
  • open file text-with-kerns.svg
  • select text
  • Extensions->Text->Split text
  • Mode: By word

What happened?

Traceback (most recent call last):
  File "split.py", line 218, in <module>
    b.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 283, in affect
    self.effect()
  File "split.py", line 205, in effect
    nodes = self.split_words(node)
  File "split.py", line 118, in split_words
    x = float(line.get("x"))
ValueError: invalid literal for float(): 0 2.2686279 3.2453442 18.810545 21.079172 22.055889 56.427742 58.696369 59.673084 65.829124 68.097748 69.074463 75.234398 77.503021 78.479736 86.58532 88.853943 89.830658 145.2778 147.54642 148.52313

What should have happened?

The extension should have separated the text.

Inkscape Version and Operating System:

  • Inkscape Version: 1.1-dev (5570b1c, 2020-02-09)
  • Operating System: Windows 10
  • Operating System version: 10.0.18362

OP from Launchpad has created an extension which does the job for absolute kerns. With his extension, the text can be split at positions where the space resulting from the kerning is larger than a supplied threshold. https://github.com/acardona/scripts/tree/master/python/inkscape

Ideally, the code from this extension would be combined with "Split text".

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information