Drawing in Figma
Set up a 256 by 256 frame in Figma, draw with a 16-unit centred stroke, export an SVG and import it as an icon source file.
Last updated
Figma is a good place to draw: it has pixel grids, a stroke that is centred by default, and a clean SVG export. The steps below produce a file that icon.py import accepts. Menu names change between Figma releases; if one is missing, look for its equivalent.
1. Set up the frame
- Create a Frame named after the icon, 256 × 256, positioned at whole numbers.
- Turn on Layout grid (a square grid, size 16) so shapes snap to multiples of 16, and add guides or a second frame outline at 32 and 224 to mark the live area.
- Optional: draw the keylines (a 192 circle, a 176 square, a 192 rectangle) on a separate layer you do not export. The anatomy figure shows them.
- In Preferences, turn on snapping to pixel grid and to geometry.
2. Draw
- Use the Pen and shape tools. Keep points on whole numbers.
- Set Stroke to 16, alignment: Center, and in the stroke options set cap: Round and join: Round. Use a solid black stroke; the color does not matter, the import ignores it.
- Do not use Outline stroke. The icon stays a set of strokes, so the build can make thin, light and bold from it.
- Use fills only for the silhouette of a closed shape (it becomes the
area) and for small solid dots. - Do not rotate or scale shapes with the transform tools after drawing: draw them at the final size. If you do, flatten (Object > Flatten selection) before export.
- Do not use text. If the icon needs letters, convert them to outlines first and keep to the rules for text.
3. Export
- Select the frame.
- In the right panel, Export: format SVG.
- In the SVG export options turn Include “id” attribute off, and Outline text on.
- Export. The file has a
viewBox="0 0 256 256"and presentation attributes on each shape.
4. Import and check
cd tooling/generator
uv run scripts/icon.py import ~/Downloads/lock-open-heart.svg lock-open-heart -c Security -t privacy,favourite,safe
uv run scripts/icon.py check lock-open-heart
uv run scripts/icon.py weights lock-open-heart
The import puts stroked shapes in the line group and filled shapes in area. Review the area group by hand: a filled shape that is meant to be a dot becomes dot, an opening becomes hole, a stroke that should read as a cut-out becomes detail. The weights page explains each role.
Tips
- Compare against
houseandgearby pasting their source into a frame; you want the same visual size and weight. - View the frame at 16 px (zoom to 100 percent, with a 16-pixel frame) often. If you cannot tell what it is, remove detail.
- Keep a component set of keylines and badges so every variant is placed the same way.