Jump to content

Recommended Posts

Posted

I exported some text as SVG, I used both options:
1 - Converted to curves and then exported
2 - Left it as text and used the "Export text as curves..." option inside the Export window

On both scenarios I ended up with files that add extra empty space after the text, like this (see the space after the G?)
image.png.fa0efe531ec2be4c5e349271243ac128.png

Is there a reason for that? Is this a bug? Is it normal and if so, how can I fix it to look like this (besides opening the file and changing the document size manually, of course, because for 1 file that's "ok", but with multiple files, that's extra useless work):
image.png.3b618ae179e78a44dca8565a57c75a9a.png

Posted

I figured it out. For some reason I'm not aware of, SVG doesn't accept decimals so if my text is 24.7px wide, when I open it with AD it will adjust the document size to 25px and that's where the empty space comes from.

Is there a reason behind this behavior of not accepting decimals? I understand that 1px of empty space is not significant, especially at the end of the text (unless you live in a country that reads right to left and in that case, it's an extra space that may have some impact on how things can become a bit blurry?), but I still would like to know if there's a reason for this and if there's a work around to make the document open with the size of the content?

Posted
2 hours ago, Danny Wyatt said:

SVG doesn't accept decimals

The SVG format does accept decimals for most values including positions and sizes.

2 hours ago, Danny Wyatt said:

text is 24.7px wide, when I open it with AD it will adjust the document size to 25px

The Affinity applications, when creating a document with Units of Pixels, need to use integers for the dimensions as there’s no such thing as a fraction of a pixel, so they round the value up if needed.

Posted
1 hour ago, GarryP said:

The SVG format does accept decimals for most values including positions and sizes.

What I mean is that, yes you can use elements with decimals, but the document itself seems to always round it up, so for example a text that's 24.7px wide inside AD, when I export it as SVG and open it again with AD, it will open a document that's 25px, not 24.7px. And this is not just for AD, because as you said, the Affinity applications round it up, but when I import the SVG to Photoshop, for example, I can see that it also adds the space at the end, meaning the SVG itself is not accepting the 24.7px as the width of the image, but 25px instead. 

Look at this example:
image.png.e9632f3d266679abcf4953ed17b0f941.png

Opening it with AD, look how the right hand side and the bottom adds some empty space:
image.png.81df35c75255e43b71317c6d81663e0d.png

Same SVG file inside Photoshop (you can see that the empty space is there, right and bottom - the S and the G)
image.png.aeed4b272d083e04463f61a13d6beb32.png

Again, this is probably not a relevant issue most of the time, but it's definitely adding space that was not supposed to be there. 

Here's an example of a green square that was snapped to the pixel (whole value) and then opened in Photoshop and aligned to a guide. And the same thing for a red square, but this one had decimals so the SVG added that extra white space at the bottom. Now when I align it, Photoshop will align the edge, which is the empty space, not the red area:
image.png.fec8db6a617e6c305822134f8bb05ef0.png

Posted
1 hour ago, GarryP said:

The SVG format does accept decimals for most values including positions and sizes.

When opening the red square file with VSCode, you can see that the file itself is saying that the viewBox doesn't have the decimals, so I believe that's what's causing this extra space:

image.png.21887cbc34872179014871b1ce2d525e.png

Posted
1 hour ago, GarryP said:

The Affinity applications, when creating a document with Units of Pixels, need to use integers for the dimensions as there’s no such thing as a fraction of a pixel, so they round the value up if needed.

I guess this proves it otherwise:
image.png.167781ac0b31a81da028aaaabc17e36a.png

I created a new document with decimals and it didn't round it up. So why is it round the SVG up, but not its own documents?

Posted

You bring up some good points that I hadn’t considered.
Rather than me just ‘arguing the toss’ over small details I think I’ll step aside and hope that an expert will come along and explain things better.
(You might want to remove the “[SOLVED]” from the thread title.)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.