FontraDocs
fontra.xyz

Variable components

A component that can change shape where it is used: one stem, drawn once, that is narrow in an I and wider in a Bold H. The feature Fontra was built around, in a short lesson.

10 minutes Intermediate Lesson
Follow along

Use the font of Your first variable font, with its Weight axis and its Regular and Black sources, or any font with a Weight axis.

The idea

A component is a glyph placed inside another glyph. A variable component is one whose glyph has axes of its own — a stem with a width axis, say. Each glyph that uses it sets those axes as it needs: the same stem, thin in one place and thick in another, and still a single drawing to correct.

1. A stem to reuse

In Preview text, type /_stem (a slash and a name stands for a glyph; the underscore says it is a part, not a letter). Double-click the grey placeholder to create it, and again to edit it.

With the Shape tool draw a rectangle, then with the Pointer double-click it and give it exact values in the Transformation panel: width 80, height 700, moved to x 0, y 0.

2. An axis of its own

Edit glyph axes: + , name it width

In the Designspace panel, find the Glyph axes section and click its tool icon, Edit glyph axes (also in the Glyph menu). Click +: a new axis appears, from 0 to 100, default 0. Name it width and click Okay.

A width slider now shows under Glyph axes. It is this glyph’s own: no other glyph has it.

3. A source at the end of it

Drag the width slider to 100. What you see there can’t be edited yet: click the + under Glyph sources and Add. The new source starts as a copy of what is shown, at width 100.

In that source, select the two points on the right of the rectangle and move them 120 units to the right (Move X 120 in Transformation, or ⇧→ twelve times). Now drag the slider: the stem grows from 80 to 200 units wide, and every width in between exists.

verify Same points, moved

As with font sources, the glyph's sources must have the same contours and points; that is why you moved points of the copy rather than drawing a new rectangle.

4. Use it as a component

Add Component, then the Location slider in Glyph info

Type I in Preview text, create the glyph and open it. Right-click the canvas and choose Add Component (or Glyph › Add Component), find _stem and click Add. The stem appears at its default, 80 units wide.

Select the component with the Pointer. In Glyph info, under the component, Location has a width slider: set it to 40 and the I’s stem is 128 units wide. Set the sidebearings as you like.

Do the same for H: two _stem components, at the same width, and a crossbar drawn as an ordinary rectangle. A glyph can mix components and contours.

5. Different in every source

The component’s location is set per source, like a point’s position. Go to the Black source of I (double-click it in Glyph sources if it is still grey, a virtual source), select the component and set its width to 100: the Black I gets a 200-unit stem. Drag the Weight slider: the I’s stem thickens with the weight, and the stem itself was drawn once.

6. Change it once

Open _stem again and change it — round its ends, make it a little taller. Every I and H that uses it follows, at its own width and in every source. That is the point of components; with variable components it holds even when the parts differ in size.

When you need a glyph’s outline as plain contours, select the component and choose Decompose Component (⇧⌘D). You don’t need to before exporting: the export turns variable components into outlines by itself.

Where to go next

Improve this page on GitHub · This documentation is licensed under CC BY 4.0 · Built 2026-10-27