Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabric 2.0 : Space removed by toSVG in multiple style text #4116

Closed
blobinabottle opened this issue Jul 21, 2017 · 19 comments · Fixed by #4119
Closed

Fabric 2.0 : Space removed by toSVG in multiple style text #4116

blobinabottle opened this issue Jul 21, 2017 · 19 comments · Fixed by #4119

Comments

@blobinabottle
Copy link
Contributor

Version

2.0 beta 3

Test Case

http://jsfiddle.net/S9sLu/1836/

Steps to reproduce

Select the word "world" hit ctrl-b to make it bold.
Hit btn "export SVG"

Expected Behavior

See the sentence "Hello world man" with all the right space.
In fabric 1.7.15 it's ok.
screen shot 2017-07-21 at 15 07 49

Actual Behavior

We wee "Hello worldman"
screen shot 2017-07-21 at 15 07 21

@asturur
Copy link
Member

asturur commented Jul 22, 2017

Fixed! I m making a beta4 today fixing a bit of things

@blobinabottle
Copy link
Contributor Author

Thanks that was awesomely fast!

@blobinabottle
Copy link
Contributor Author

It seems this bug is back in beta 6 in Safari ?

@asturur
Copy link
Member

asturur commented Aug 31, 2017

Can you paste here a full svg i can try in safari?

@blobinabottle
Copy link
Contributor Author

Is this ok? Do you see the bug?

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="300" height="300" viewBox="0 0 300 300" xml:space="preserve">
<desc>Created with Fabric.js 2.0.0-beta6</desc>
<defs>
</defs>
	<g transform="translate(185.5 123.1)">
		<text xml:space="preserve" font-family="Times New Roman" font-size="40" font-style="normal" font-weight="normal" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" >
			<tspan x="-175" y="12.57" >Hello </tspan>
			<tspan x="-76.13" y="12.57" style="font-weight: bold; ">world</tspan>
			<tspan x="23.87" y="12.57" > man</tspan>
		</text>
	</g>
</svg>

@asturur
Copy link
Member

asturur commented Sep 1, 2017 via email

@blobinabottle
Copy link
Contributor Author

Shouldn't we reopen this ticket? Did you find if the bug come from safari or fabric? :-)

@asturur
Copy link
Member

asturur commented Sep 7, 2017

did not open safari yet.

@asturur
Copy link
Member

asturur commented Sep 7, 2017

Looks like safari is ok if we put the style white-space to each tspan.
image

@blobinabottle
Copy link
Contributor Author

okay cool, so you think it could be "easy" to fix?

@asturur
Copy link
Member

asturur commented Sep 7, 2017

yes it is.

@nitin-bc
Copy link

Hi,
I am facing the same issue in 1.7.9. Please refer attached image for SVG and try to open it with browser and image viewer and see the difference.

Thank You.

@asturur
Copy link
Member

asturur commented Mar 22, 2018

@nitin-bc we cannot take care of differences between browser and image-viewer. Only fabricjs related issue or svg non conformities.

@nitin-bc
Copy link

Yes, I can understand your concern and I am not asking to compare them both. I just want to convey you that space is being removed while generating the SVG image.

Hope you are getting me.

@nitin-bc
Copy link

Hi @asturur, would you please update me on this if possible?

@nitin-bc
Copy link

Hi Everyone,

Is there any update on this for me? It would be great if someone can help me out as soon as possible.

Thank You.

@asturur
Copy link
Member

asturur commented Mar 26, 2018

You are using 1.7.9 and not latest 1.7.22 and we do not have a reproducible case for it. We can t really help in this way

@nitin-bc
Copy link

I have used the latest one and seems working fine. Thank you. But in this case for masking feature, I can't see the added image to the canvas, even I have set the "Objectcaching:false" already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants