Page Index Toggle Pages: 1 [2] 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Issue with text on SVG node. (Read 13980 times)
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #15 - Oct 26th, 2022 at 3:21am
Print Post  
Slavcho wrote on Oct 25th, 2022 at 3:15pm:
Quote:
What about filled characters after reexport?


Your path2.svg example shows a filled "e" in browsers and Inkscape too, so the path definitions it contains fill the "e" area, or maybe do not set proper fill-rules. What tool / code are you using exactly to "make SVG from text"?


I use MindFusion.Diagramming.Wpf.Export.SvgExporter. Firstly, I exported text from diagram to SVG and add it to another diagram. After that, I exported to SVG the second diagram with this SVG. First SVG contains tag "text", but second export all with "path" with filled characters.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #16 - Oct 26th, 2022 at 9:15am
Print Post  
SvgNode renders SVG <text> elements as paths indeed, due to them supporting separate stroke / fill, and some other effects. Then SvgExporter finds the paths in WPF visual tree and creates respective <path> markup. We guess we could add some special handling for solid-color texts to avoid the paths.

Try this build for text bounds fix -
https://mindfusion.eu/_beta/wpfdiag383.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #17 - Oct 26th, 2022 at 11:52am
Print Post  
Thank you for the update. Size the similar regardless of topleft.
But if bounding box of text would be like as on pictures it stretches. I use ContentSize Fit. Can we export it with saving size of bounding box? Empty symbol, for example?
  

ft.png ( 13 KB | 130 Downloads )
ft.png
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #18 - Oct 26th, 2022 at 11:53am
Print Post  
Result svg with Fit.
  

st.png ( 16 KB | 128 Downloads )
st.png
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #19 - Oct 26th, 2022 at 12:01pm
Print Post  
Slavcho wrote on Oct 26th, 2022 at 9:15am:
SvgNode renders SVG <text> elements as paths indeed, due to them supporting separate stroke / fill, and some other effects. Then SvgExporter finds the paths in WPF visual tree and creates respective <path> markup. We guess we could add some special handling for solid-color texts to avoid the paths.


It would be cool! Could you give ETA, please?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #20 - Oct 31st, 2022 at 9:43am
Print Post  
This build gives priority to the viewbox (which you can control using diagram.Bounds before exporting):
https://mindfusion.eu/_beta/wpfdiag383.zip

If you want to revert to using bounds of inner SVG elements, enable new SvgNode.ContentAutoBounds property.

We have to release v383 this week, our developer will look into text/path conversions after that.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #21 - Nov 28th, 2022 at 8:05am
Print Post  
Hello! I want to clarify if conversions problem was fixed. And I've faced another problem with text on SVG node - text doesn't render weight other than default if I try to change it using TextAttributes.
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #22 - Nov 28th, 2022 at 11:09am
Print Post  
Oh, and there is a problem with text opacity as well. It seems like it is not taken into account the diagram is exporting.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #23 - Nov 29th, 2022 at 7:40am
Print Post  
Quote:
Hello! I want to clarify if conversions problem was fixed. And I've faced another problem with text on SVG node - text doesn't render weight other than default if I try to change it using TextAttributes.


It's still imported as a path. Generally, we've implemented SvgNode to let people show SVG icons in their flowcharts, and not to create full-fledged SVG editors Wink We 'll try to add import-as-text option for upcoming v3.9 release.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #24 - Nov 29th, 2022 at 8:08am
Print Post  
Quote:
Oh, and there is a problem with text opacity as well. It seems like it is not taken into account the diagram is exporting.


Do you mean semi-transparent DiagramItem.TextBrush?
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #25 - Nov 30th, 2022 at 6:17am
Print Post  
I mean opacity of DiagramItem(UI element).
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #26 - Nov 30th, 2022 at 7:25am
Print Post  
Ah right, you had a custom node type that only draws text, and setting UIElement.Opacity on it? Our developer will check this scenario.
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #27 - Nov 30th, 2022 at 9:33am
Print Post  
Yes, this is exactly my scenario
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3440
Joined: Oct 19th, 2005
Re: Issue with text on SVG node.
Reply #28 - Dec 1st, 2022 at 2:37pm
Print Post  
Try this build for opacity and font weights -
https://mindfusion.eu/_beta/wpfdiag39.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 124
Joined: Aug 25th, 2022
Re: Issue with text on SVG node.
Reply #29 - Dec 2nd, 2022 at 6:21am
Print Post  
Opacity works perfectly, thank you. But weight is still not imported.
  

Kc2YP3X56s.png ( 2 KB | 128 Downloads )
Kc2YP3X56s.png
gRPAcoZniU.png ( 4 KB | 134 Downloads )
gRPAcoZniU.png
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send TopicPrint