Rhino 8 icon svg import doesn't support text

Hi, I am working on updating our tools for Rhino 8, but I can’t import SVG’s properly.
It reads hatches OK, but not text:

The current icon drawing tool is still a mess and a joke so I draw them in Rhino and export them as png, but since I can’t import text I currently have to explode the text, hatch the curves and export them, then undo to keep the text for later. Slow, painful and easy to do something wrong.

Can you update the svg importer in the icon maker to support text?

@dale is this for you?

Hi @Holo,

Can you provide a .svg file that does not import correctly into the button image editor?

Thanks,

– Dale

Sure, I made a workaround to explode, hatch, copy settings etc so I need to manually generate one for you. But here are they both.

text_Fail
text_as_hatch

The text_as_hatch imports fine as an icon.

I draw my icons in Rhino and print them on a 40x40 mm canvas.

In general I would recommend against using text in SVG for icon work. There are many cases where things like fonts are not going to be available or our svg to image conversion routines will fail.

2 Likes

OK, so I have given this some thought.
IMO support what you support well.

So in short: It needs to be able to read in text or at least acknowledge that text was ignored. If Rhino can read SVG’s with text then so should the icon generator (If it is troublesome then make a workaround behind our backs)

But Rhino struggles to read in text too, and other things with SVG’s.

Test this:

  • Make a new document.
  • Drag in the text_as_hatch.svg and use the default settings for importing the data.
    (and move the content out of the way for the next file)
  • Drag in the text_Fail.svg and use the default settings again.

Issues:

  • No hatches were generated, hatches are imported as outlines
  • Content is grouped, and similar content from the other file is added to the group, so now both arrows etc are double grouped with each other.
  • Text is not read in with the correct scale: Both icons have text objects, but the text_as_hatch has outlined the hatches as well (Those that I made to work around the icon tool’s lack of text support.) and these lines are in the correct size, but the text is bigger.

image

IMO the icon tool in Rhino 8 is the worst icon experience I have ever had. It is horrible to draw in, circle tool fails more often than not, it is not possible to edit stuff, colors are bad, fills are lacking and yeah… I think I can stop there.

Rhino has great drawing tools, please make use of them in the icon tool. Maybe you can make a mini-modelling environment in a new window (like UVeditor) so everybody don’t have to script their own workaround.

Final comment:
Why am I stressing this? Because you want developers to adapt to Rhino 8 as soon as possible. If this isn’t easy then I fear a lot of tools will not migrate to Rhino 8 properly, soon, easily or at all. Maybe I am the only one seeing this as a bigger problem than it is, and if so I am gladly wrong.

Some more examples here - I wanted to try modifying the Project and Pull .svg’s so I exported them from the button editor.

Project:

Pull:

(they’re way too similar, that’s why I’m playing with some way to better differentiate between them)

Here’s what the imports into Rhino look like - I used the “Hatches” option so hatches should import:

Project:

No hatches at all, just 4 curves. One corner isn’t even clean.
(The 48 x 48 outer square is mine, not part of the import.)

Bad corner actually looks like this:

Pull:

One hatch and three curves.

Yahhhhh… :exploding_head:

Edit:
So I tried to make an icon image that was a bit more explanatory for Pull just for kicks.
I tried recreating the missing bluish hatch using Rhino’s gradient hatch, which works fine. Added a couple of arrows to indicate that it isn’t being projected in just one direction like Project… Looks like this in Rhino:

Well, it won’t be that great when smaller, but WTH…

Go to export it as .SVG:

Et merde, .SVG export does not support gradient hatches… :exploding_head: :exploding_head:

Wwwait… Actually something does export. Looks like this when re-imported:

But the gradient hatch is no longer gradient. :sob:

2 Likes

Hi,
You mention updating your tools for Rhino 8, but if I understand it correctly you import SVG’s as a workaround and was not doing that in Rhino 7?

Because I have been importing SVG images created by the GNUplot graph utility, and never have been able to import the texts in Rhino 6 or 7, so it would be interesting to know if it ever worked in Rhino 7 for some SVG images. Importing numbers on the axis of my graphs would be a big help.

The current version of Rhino 8 can export and import text as SVG. The problem is the icon editor still does not support .svg’s with text - as per the subject of this thread.

If you are not making icon images, then text should import I guess. A quick test works here in V7 and V8. Maybe post an example of what is not working for you.

Maybe it’s something in the way GNUplot creates the SVG. I already tried different font settings in GNUplot but never managed to get the text in Rhino. Here is an example SVG generated by GNUplot:
run702k

OK, yep I see that. Opening it in Rhino 8 here the text is gone. Opening it in a browser or Photoshop shows the text. So this does appear to be a problem with the Rhino SVG importer. It is not fully developed yet…

Text created in Rhino and exported as SVG does seem to work and re-imports into Rhino as text…

TextTest

However the original was created as one multiline text block, on export SVG and re-import, it is four separate text lines.

I created a YouTrack item for this - there are quite a few for SVG.
https://mcneel.myjetbrains.com/youtrack/issue/RH-81257/Import-SVG-loses-text

1 Like

If I open my SVG in Firefox, print it to PDF and open the PDF in Rhino 7, I do get all the text objects, so I don’t think the issue is with the used font.

Another data point: In addition to PNG and SVG, GNUplot can also output to postscript. If I convert the .ps file to PDF using the Linux “epstopdf” tool, I get a PDF with some scaling issues (because I still set output size in pixels), but does contain the texts. When I open this PDF in Rhino 7, the texts are missing, similar to importing the SVG version.

Some of the issues are fixed now. They’ll be in 8.7. I’m still working on the shifting of the subscripts for Fx and Fy.

Incidentally, it had to do with the text being in <tspan></tspan> nodes. I had not seen one of those when I was originally working on SVG import.

RH-79097 is fixed in Rhino 8 Service Release 7 Release Candidate

1 Like

Hi @Helvetosaur,

are you able to export text from Rhino to SVG ? I do not see this working, text is just ignored.

thanks,
c.

Hi Clement,

The export seems to be working, I can see the text when I open in a browser or Photoshop, but the Rhino icon editor does not see it. I have the latest SRC here, but not the daily builds.

Hi Mitch, ok. I can confirm export works over here using R8 SR7. Also import of the SVG into Rhino brings in the Text. It’s the SVG import in the button editor which fails to read the text.

thanks,
c.

Does this also fail in TestSvgEdit? In general we try to avoid text in svg buttons due to the dependency of a font existing on a different computer.

Hi @stevebaer, yes. It’s not a big problem, i’ll just write a script which converts text to hatch then. Below is the test icon i’ve used.

TestIcon

thanks,
c.