Jump to content
You must now use your email address to sign in [click for more info] ×

Problems with SVG file.


Recommended Posts

I am trying to create an SVG for a Fritzing schematic part that has a breadboard element. The requirement for such a part is that a large number of what it calls connections i.e. graphic elements are hide under a graphic element that is part of the non breadboard element. I had as a starting point an SVG created by somebody else. I could not work out how to make the required changes easily using Inkscape so invested in Affinity Designer. Sure it was easy to make what I assume are the correct changes. The problem is when I try and use the file in Fritzing after exporting to SVG in Designer the file is no where near correct. 

 

Okay I tested by opening the SVG in Designer and without making any changes exported to SVG. What was a 62K SVG file is now only a 12K SVG file, so Designer has munged it some how.

Original.svg

Exported.svg

Link to comment
Share on other sites

I'm not an expert with the SVG file format, however a quick inspection of the two files would indicate that the program used to create the original file (CorelDRAW X6) was horrendously inefficient. (Don't forget, SVG files are XML based so you can look through them meaningfully in your favourite text editor.) Take for example the creation of the 'Mikrobus-Proto-22' text object, in Corel:

 

<g >
    <g transform="matrix(1 0 0 1 -16881.1 -50490)" >
        <g >
            <g >
                <g >
                    <g >
                        <g >
                            <text font-weight="normal" gorn="0.1.1.1.0.0.0.0.0.0.0" font-family="Droid Sans" id="label" font-size="3529.2" x="65802"  y="104855" fill="black">Mikrobus-Proto-22</text>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</g>

 

Whereas from Affinity:

<g id="label" transform="matrix(1,0,0,1,48920.9,54365)">
    <text x="0px" y="0px" style="font-family:'LucidaGrande';font-size:3529.2px;fill:black;">Mikrobus-Proto-22</text>
</g>

Now (again no expert so I might be missing something, but) it would appear that there are many redundant <g > tags each adding to the overall file size. Without them the file becomes much smaller without realistically changing the final product. Well, aside from the change in font as I assume you don't have Droid Sans installed...

 

Kind of an example of lossless compression (https://en.wikipedia.org/wiki/Lossless_compression)

Link to comment
Share on other sites

The two SVG files draw the same visually as far as I can tell. It may be that Fritzing has some special requirements. There are a lot of options in File > Export > SVG > More; changing some of them may help. When you say it's not correct, what is it that goes wrong? Does it miss out elements, or get the size wrong, or is it colour or position or structure?

Link to comment
Share on other sites

No No No the two files are not the same. As I said in my original post Fritzing requires that all the breadboard elements are hidden under schematic elements. If you compare the exported file to the original Designer has thrown away the whole of the group named breadboard.

 

I looked  at the options on export SVG and did not see any that should be effecting this.

 

What is wrong the file when loaded into Fritzing? the schematic is all messed up and there are no allocated connectors

( i.e. all the things that should be in the breadboard group.

 

Question Do I need to report this in the bugs section?

Link to comment
Share on other sites

I'm not an expert with the SVG file format, however a quick inspection of the two files would indicate that the program used to create the original file (CorelDRAW X6) was horrendously inefficient.

 

I don't think it is CorelDraw at fault the orginal SVG files were created with a program brd2svg which is an application for converting PCB boards created in Eagle to SVG's required for Fritzing. Unfortunately this program is no longer under development and is known for not creating efficient SVG's. A contact in the Fritzing forum worked on the files and he uses Coral Draw hence the name of the program in the SVG being CorelDraw. I have a Mac and don't have CorelDraw so using it to make the required adjustments is not an option for me.

 

Designer saving as more efficient SVG would be good, but not at the expense of throwing away whole groups.

Link to comment
Share on other sites

  • 2 weeks later...

Are you using a beta version of Designer or the App Store version? If the App Store version, I am a little confused about why this is posted in the Beta forum...

 

Anyway, opening the original in the current App Store version (1.4.1), I noticed that everything I checked in the breadboard group has neither stroke nor fill, which may explain why Designer omitted it.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

×
×
  • 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.