Icons & Vector

The icon grid and keylines

An icon is drawn small and seen smaller. At 24 pixels every unit is one pixel, and a line half a pixel off goes soft, with a gray row on each side. An icon frame helps you avoid that: it shows its units as a grid and the keylines of an icon over them, and what you draw in it keeps to whole pixels. Draw every icon of a set in one, at one size, with one weight, and the set looks like a set.

The keylines of a 24 frame, over its units
The keylines of a 24 frame, over its units

Make an icon frame#

By hand
  1. Press F for the Frame tool. Its strip at the top of the canvas lists sizes.
  2. Open Icon ▾ and choose Icon 16, Icon 24, Icon 32, Icon 48 or App Icon 1024.
  3. The frame appears at once in the middle of the view. It is a component, with no fill, and its Icon Grid on.
The Frame tool's strip, with the Icon chip before Custom
The Frame tool's strip, with the Icon chip before Custom

Any square frame or component can become one. Select it and turn on Icon Grid in the inspector: one line with a switch. The line under it, Scale Strokes, is for components and is covered below.

Icon Grid and Scale Strokes in the inspector of a 24 component
Icon Grid and Scale Strokes in the inspector of a 24 component

Draw at 24 unless your set says otherwise. It is the size most interface icons are drawn at, and the one the examples here use.

The keylines#

Keylines are a guide to proportion. A circle looks smaller than a square of the same width, so it is drawn larger to match. Start each shape on one of these:

KeylineAt 24Use it for
The area an icon keeps to20 × 20, a margin of 2The outer edge of everything, strokes included
Square18 × 18A box, a calendar, a document seen whole
Circle20 acrossA clock, a user's head, a coin
Upright rectangle16 × 20A phone, a page, a bottle
Level rectangle20 × 16A card, a screen, a folder
Cross and diagonalsThrough the middleFinding the middle, and the angle of a slash

The keylines are scaled to the frame, so a 48 frame has the same shapes at twice the size. From 400% the frame also shows a line between each unit. None of it is ever exported. View › Icon Grids hides the grids and keylines of every icon frame.

An App Icon 1024 frame shows other guides: a square a tenth of its side in from every edge, which is where what matters should stay, three circles about the middle, and the cross and diagonals. The frame stays a sharp square: the App Store rounds the corners itself.

Draw on whole units#

In an icon frame, what you move or resize, the points and handles of a path you edit, and the anchors the pen puts down all go to the frame's pixels and nothing else. Hold ⌘ to let go of that for one move.

The reason is plain at 24 pixels. A 2-unit stroke whose middle is on a whole unit covers two rows of pixels exactly. Move it by half a unit and it covers three, two of them half: the line goes soft.

The same plus sign at 24 pixels, on whole units and moved by half a unit
The same plus sign at 24 pixels, on whole units and moved by half a unit

To place a shape in the middle of the frame, select it and choose Arrange › Center to Keyline, or press the last button of the bar of vector actions. Nox centers what is drawn, strokes counted, and starts it on a whole pixel. A shape centered by eye can land on a half.

Stroke weights#

  • Use 2 at 24. Use 1.5 only for an icon that will only be seen on 2x screens.
  • An odd weight lies on half units. A stroke of 2 is sharp with its line on a whole unit; a stroke of 1 (or 3) is sharp with its line on a half unit, such as 4.5, because it then covers whole pixels. Nox draws it that way, and the icon frame snaps odd-weight lines to half units.
  • Use one weight for the whole icon, and the same caps and joins. A door of 1.5 in a house of 2 looks like a mistake, because it is one.
  • Round caps and round joins suit most interface icons. They soften the corners the same way everywhere.
  • Keep the stroke inside the area. At 24, the area is 2 to 22, and a stroke of 2 reaches 1 unit past its line, so points stay between 3 and 21.
  • Make circles as ellipses and round corners with a radius on the point, not by drawing the curve by hand. See The pen and paths.

Scale Strokes on a component says what an instance at another size does with lines. On, an icon placed at twice its size has lines twice as heavy, as a picture would. Off, the shapes grow and the lines stay as drawn. Icons brought in from SVG or PDF have it on.

A small icon, step by step#

A house: a closed path for the roof and walls, and an open one for the door.

Four steps: the frame, the outline, the rounded base, the door
Four steps: the frame, the outline, the rounded base, the door
By hand
  1. Make an Icon 24 frame and zoom in until you see its units.
  2. Take the pen (P). Click at (4, 11), (12, 4), (20, 11), (20, 20) and (4, 20), then click the first anchor to close the path.
  3. Remove its fill in the inspector, give it a stroke of 2, and set Ends and Joins to Round in the bar of vector actions.
  4. Double-click the path, select the two lower anchors, and type 2 into Radius.
  5. Draw the door as an open path: (10, 20), (10, 14), (14, 14), (14, 20). Press Return to leave it open.
  6. Name the frame Home.

Every point is on a whole unit, between 3 and 21.

With an agent

Give the size, the weight and where each point goes. Numbers leave nothing to guess.

Draw a Home icon as a 24 component with the icon grid: a closed path for the
roof and walls through (4,11) (12,4) (20,11) (20,20) (4,20), the two lower
corners rounded by 2, and an open door (10,20) (10,14) (14,14) (14,20).
No fill, stroke #14171C at 2, round caps and joins. Then check it.

The agent calls create_nodes with:

{
  "nodes": [
    {
      "kind": "component", "name": "Home", "x": 0, "y": 0, "width": 24, "height": 24,
      "fills": [], "icon_grid": true,
      "children": [
        {
          "kind": "path", "name": "House", "x": 0, "y": 0,
          "points": [
            { "x": 4, "y": 11 }, { "x": 12, "y": 4 }, { "x": 20, "y": 11 },
            { "x": 20, "y": 20, "radius": 2 }, { "x": 4, "y": 20, "radius": 2 }
          ],
          "closed": true, "fills": [], "stroke": "#14171C", "stroke_width": 2,
          "stroke_cap": "round", "stroke_join": "round"
        },
        {
          "kind": "path", "name": "Door", "x": 0, "y": 0,
          "points": [ { "x": 10, "y": 20 }, { "x": 10, "y": 14 }, { "x": 14, "y": 14 }, { "x": 14, "y": 20 } ],
          "fills": [], "stroke": "#14171C", "stroke_width": 2,
          "stroke_cap": "round", "stroke_join": "round"
        }
      ]
    }
  ]
}

It then calls check_icon on the component, which answers "clean": true, and render_preview with "sizes": [16, 24, 48] to look at it small.

To have a drawn icon listed with the ones you brought in, in Assets › Icons, an agent sets icon_asset: true on its component with update_nodes.

Note

Draw a 16 version of the icons that matter at 16. A 24 drawing shrunk to 16 lands its lines between pixels, and no amount of care at 24 prevents that. See Check and export icons.