Skip to content

Instantly share code, notes, and snippets.

@dzintars
Last active February 19, 2024 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzintars/6443e72e4b0ae058f5fb8a8fc6b3f9c6 to your computer and use it in GitHub Desktop.
Save dzintars/6443e72e4b0ae058f5fb8a8fc6b3f9c6 to your computer and use it in GitHub Desktop.
How to Simple-Icons

How to create SVG cutouts/gaps in Inkscape

If you found this Gist, then keep in mind that it is not complete unting this message gets removed. There are missing steps.

TODO

  • Remove fill
  • Set the viewport
  • Export clean SVG
  • Optimizations?

Instruction

Import your original SVG file from File -> Import menu:

image

image

Select entire icon an find out its bounding box size

image

As we see, it's in millimeters if you just installed Inkscape. Change it to pixels:

image

As we can see, it's a perfect square in this case.

Q: What if it is not a square?

Lock the proportions so that width and height always changes proportionally:

image

Change the icon size down to 24px and zoom in:

image

Make sure selection tool is selected:

image

Double click to select single element/path:

image

In the Layers and Objects pane on the right side you can see what is selected:

image

Select from the main menu Object -> Fill and Stroke.... New tab in the right side will appear.

Set Stroke paint to flat/solid type

image

Set the Stroke style -> Width to 0.25pt

image

Do it for all elements. You can do the same by selecting all paths at once. Be sure to first change the measurement to pt and only then to change the value to 0.25.

image

Keep the all paths/objects selected. Or select them all again.

Go to Path menu and select Stroke to Path. You should end up with double of paths/objects:

image

Now select the first group, then right click and select Ungroup.

image

Don't do it the same for the all groups yet now. Keep working now with this single element.

Keep the selection of booth paths.

Stroke should be above and the figure should be below the stroke. The order of the objects is important to keep so that Inkscape knows what should be subtracted from what.

Got to Path and select Difference

image

You should end up with the stroke path being deleted and the cutout being made for the element.

Now you can do the same steps for the every single other element.

Select element group -> Ungroup -> Path -> Difference.

You should end up with the all cutouts

image

Select all objects/paths, go to Path and select Combine.

image

You should end up with one single combined path.

But it's size now will not be exact 24px because we subtracted those cutouts.

image

Look at the largest value and increase its size to 24px. Don't change the other value as this will ruin the original proportions of the icon. Keep that lock icon closed.

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