fritzing-parts icon indicating copy to clipboard operation
fritzing-parts copied to clipboard

Added Pin Labels to MicroSD Card module

Open Tombstone2K opened this issue 1 year ago • 8 comments

I edited the included part for the microSD card module, adding labels for the various pins. I have attached an image showing the original part and my edited part as well as the fzpz file (inside the attached zip file).

microsd_photo

microsdmodule_label.zip

How do I help merge these changes ?

Tombstone2K avatar Jul 20 '23 17:07 Tombstone2K

To help further, you can create a pull request, where you update the modified SVG file (the breadboard svg in this case).

For this simple change it can be done via the github webfrontend.

KjellMorgenstern avatar Jul 22 '23 16:07 KjellMorgenstern

"create a branch" to get started image

KjellMorgenstern avatar Jul 22 '23 16:07 KjellMorgenstern

Thanks for your help.

I am not able to find a "create a branch" option.

git_create_a_branch

It seems like I need to be given some permissions before I can create a branch.

Regards

Tombstone2K avatar Jul 23 '23 07:07 Tombstone2K

No need to be in the core team to make a PR. Please check with a github tutorial, it is essential knowledge.

KjellMorgenstern avatar Jul 23 '23 07:07 KjellMorgenstern

No need to be in the core team to make a PR. Please check with a github tutorial, it is essential knowledge.

I created a Fork, committed the change to that, and opened a pull request in the main repo. Thanks for your help

Tombstone2K avatar Jul 23 '23 08:07 Tombstone2K

I reviewed the part, and it works :-)

But since we want to improve our parts format (and the workflow to add new parts), forgive me if I am a bit picky.

Which tool did you use to insert the text? The text tags are quite convoluted:

<text
   xml:space="preserve"
   transform="matrix(0,0.75000031,-0.75000031,0,31.587174,-10.779515)"
   id="text1047"
   style="font-size:5.33333px;white-space:pre;shape-inside:url(#rect1049);fill:#f9f9f9"><tspan
     x="30.642578"
     y="31.739384"
     id="tspan621">CS</tspan></text>

So there is a text element, that has a transform matrix. Ok. But: It also references to be shape-inside "rect1049". This will offset quite a lot of tools. Then, the text is inside a tspan, which again has x y coordinates.

Fritzing renders it correct, but more or less by random: Fritzing simply throws away most style attributes, which are not valid TinySVG, so it ignores the "shape-inside" .

Fritzing tries to interpret the font-size, but the font-size is given in px, which is somewhat awkward if you take into account that the text transform matrix has some scaling, and the whole SVG is specified in inches in the header. I think Fritzing patches this by ignoring the "px", and does not try to use the actual resulting pixel size. From a quick search: The relationship between px and physical units has been defined in CSS 2.1 . Fritzing uses TinySVG, which does not allow any CSS.

From the line formatting, it looks like the FritzingCheckParts script has been applied, is that correct? The script fixes some things, but sometimes makes it quite hard to review changes because of the reformatting.

Because of the header, I assume Adobe Illustrator was used, but typically illustrator does not add a width/height in inches. Did you fix that manually?

The SVG without automatic filters from Fritzing (when passing the file to the rendering library without 'filter') image

KjellMorgenstern avatar Aug 17 '23 16:08 KjellMorgenstern

To have it rendered correct, I had to remove the tspan:

<text
   transform="matrix(0,0.75000031,-0.75000031,0,52.252742,-7.1124403)"
     style="font-size:5.33333px; fill:#f9f9f9"
     x="30.642578"
     y="31.739384">MOSI</text></svg>

tspan (and QtSVG , our renderer) are a known problem: https://graphicdesign.stackexchange.com/questions/157314/inkscape-save-tiny-svg-for-qtsvg-compliance

The problem is that QtSVG ignores the x,y in the tspan, and only applies the matrix transform. Not a bug, indeed x y offset (and rotation) are not supported: https://www.w3.org/TR/SVGTiny12/text.html#TSpanElement

KjellMorgenstern avatar Aug 17 '23 16:08 KjellMorgenstern

@KjellMorgenstern I had used Inkscape to add the text labels to the pins.

I am a bit new to vector graphics. Thanks for fixing the issue if any.

Is there anything further required on my end ?

Regards

Tombstone2K avatar Aug 20 '23 10:08 Tombstone2K