Jump to content

Export SVG - blank space what am I doing wrong?


Recommended Posts

Every time I export to SVG, I get black space on one side so the image is not centered. I'm not sure what I'm doing wrong.

my creation:

image.png.91bc6f0527bc8840e350fbe8c9cf3eaf.png

after export svg (selection only) - there is only text on the page, nothing else. Once exported and reopened in affinity it looks like this :-

image.png.6d1a83434d4da3a0122c2ac372073504.png

When I open it, in a project I'm using, it looks like this:-

image.png.5e59f0529e5dc06d207267fb30b00da1.png

 

It always has extra space on the right side, when there was no extra space originally. What am I doing wrong? How can I get each project I create centered.

 

Link to comment
Share on other sites

Have you tried converting the text to curves before exporting to SVG?

The letter spaces look odd, have you edited the text somehow? In the Project screengrab the text looks correctly spaced?

 

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to comment
Share on other sites

Show your SVG export settings, or even better attach the whole generated SVG file here for a review. - Further how do your SVG export options look like (see the more button on the bottom of the export panel), when you export as "selection only" from the export panel?

Do you have probably added accidently some space char after "Hello" so maybe like this "Hello "?

If I try what've shown above in ADe v1, things look like expected ...

hello1.jpg.4984b43e651b935b5841931aee93edf2.jpg

hello3.jpg.b65c098cfbcea2c92b9471686064abf1.jpg

hello2.jpg.3a1c91a82cf6f0c3981ac8a7b57c77b1.jpg

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

3 hours ago, v_kyr said:

things look like expected ...

Note, @iconmuse had tracking applied before export. – It looks quite similar to me and appears SVG doesn't handle tracking correctly. 

svgtracking.thumb.jpg.363f0c4a0fca625ca73e6cecec9286be.jpg

v1105 Hello.svg 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1191 879" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
    <g transform="matrix(1,0,0,1,-850.227,-700.227)">
        <text x="813px" y="1033px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:464.883px;fill:rgb(0,141,71);">Hello</text>
        <g transform="matrix(1,0,0,1,0,539.93)">
            <text x="813px" y="1033px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:464.883px;fill:rgb(226,102,38);">H<tspan x="1195.21px 1500.25px 1650.02px 1799.79px " y="1033px 1033px 1033px 1033px ">ello</tspan></text>
        </g>
    </g>
</svg>

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

2 hours ago, thomaso said:

Note, @iconmuse had tracking applied before export. – It looks quite similar to me and appears SVG doesn't handle tracking correctly. 

In that case the by Affinity generated text size isn't handled correctly during the Affinity SVG code generation (export).

1)  How things should be for doc + text size, but with rounded up/down values then during SVG export for selection only here ...

test1.jpg.a643883ae27eaf64f06be7cef689b798.jpg

2) What instead actually happens instead with the text size during export  ...

test2.jpg.a664b67f9b8a7899ba8d7154e5e34363.jpg

3) If the Affinity dev team always only checks SVG code generation things via "<svg width="100%" height="100%" ..." then they probably won't recognize that in a webbrowser preview, as ...

test3.jpg.82a0f053cf6079497d894e2e05eb3874.jpg

... versus ...

test4.jpg.e43d0ec6b9754e6f53f13f15e9b2c17d.jpg

So the whole is more due to the fact, that Affinity in this case doesn't generate correct dimension sized SVG text code here. So that's sort of a bug!

Thus the OP shouldn't use tracking here for SVG and so better avoid this for any SVG export (code generation). Further if the whole is for some website or iOS app prototyping, it's even better to not rely entirely on Affinity here with SVG text centerings and the like, as for websites it's better to define SVG positionings via HTML/CSS and for iOS apps etc. to do that via Xcode and the like here!

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

48 minutes ago, v_kyr said:

So the whole is more due to the fact, that Affinity in this case doesn't generate correct dimension sized SVG text code here. So that's sort of a bug!

Thus the OP shouldn't use tracking here for SVG and so better avoid this for any SVG export (code generation).

Different to tracking it appears that hairspaces get transferred correctly with SVG export.

But this unveils an UI / redraw glitch in Affinity: Different to the initial text frame Affinity does not display in the placed SVG its special character 'hairspace' symbols below a minimal zoom level, in this setup for instance 58 %, although the object has a width of ~12 cm in this sample.

svghairspaces.thumb.jpg.db2a9670d582f47fc77ba0e5d98c20d8.jpg

svghairspaces2.jpg.73f85e2accabdd790b293cdb5b0fe3a3.jpg

v1105 Hello Hairspace.svg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

8 hours ago, thomaso said:

Different to tracking it appears that hairspaces get transferred correctly with SVG export. ...

Well those are treated in SVG as common font glyphs, the SVG spec tells all here about certain aspects about SVG text and tspan definitions etc.

Commonly just like in HTML, SVG suppresses consecutive spaces and line breaks in the text. For things like the above mentioned text with tracking, in SVG one usually would use text with setup letter spacing values. - For a quite good made overview article related to SVG text I recommend to take a look over this one ...

For text aligment treating in SVG read this follow up article then ...

NOTE however that Affinity apps do only support (and generate) a minimal subset of what "SVG text" usually offers here.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

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.