1

I am using matplotlib (Python 3.8) to export my figures as svg. When importing those figures into Adobe Illustrator (CC 2018/22.1), the text is split up per letter, i.e. the letters in "Irradiance" (see pic) are all editable, but I can only edit one letter at a time, which is inconvenient. The numbers (10-70 in the image) are however exported as one text item and are not split up.

Additionally, I get the following error message: "The document uses fonts which are not available". The text is however imported after I exit the dialog box, in the font that I want. Sometimes I get this error, but not always...

How can I export svg files that have completely editable text?

Error message

enter image description here

Screenshot of figure in Adobe Illustrator

enter image description here

Code for exporting svg's using rcParams

This block of code is at the start of my script:

mpl.rcParams.update(mpl.rcParamsDefault)
mpl.rcParams['font.family'] = 'Open Sans'
mpl.rcParams['font.size'] = 14
plt.rcParams['svg.fonttype'] = 'none'

Then I save the figure using: fig.savefig(Directory + 'my_figure.svg', transparent=True)

3
  • 1
    It's not a proper answer but anyway, there is the script for Illustrator that can join a selected text objects into one text frame. I'm using one of the variants of such script all the time exactly for such cases. ajarproductions.com/blog/2008/11/23/… Commented Feb 27 at 12:59
  • 1
    Here is the script (Join Text Frame) I'm using for many years: kelsocartography.com/scripts/#john Commented Feb 27 at 13:02
  • Hypothetically the script can be modified to make it to find all text objects and join them whenever their Y-coordinates are identical and differences between X-coordinates less than the width of a couple of characters. Though the question looks abandoned. Commented Mar 2 at 14:27

0