This guide turns a set of Figma icons into a web icon font with UIXport's free Icon Font tool. It covers when an icon font fits, how to prepare the icons, how to compile them, and how to use the files on a site.
When an icon font is the right choice#
An icon font turns each icon into one glyph. You size it with font-size and colour it with color, like text.
- Good fit: a set of single-colour UI icons that a developer wants to drop in with a class name.
- Poor fit: multi-colour icons, because each glyph has one colour. If you need several colours, or you want to style parts of an icon separately, export SVG instead. The SVG export page covers that route.
- Raster icons: the CSS sprite tool, in the same tab, makes a PNG sprite sheet with CSS classes.
If you are still deciding between a font, an SVG sprite and inline SVG, icon font vs SVG sprite vs inline SVG weighs them on accessibility, colour and caching.
Prepare your icons in Figma#
UIXport exports each selected layer as SVG, then reads only the <path d> data. A clean icon is one filled vector path, or a few.
Do this before you compile:
- Outline strokes. Right-click a stroked layer and choose Outline stroke, or press Cmd+Option+O on Mac or Ctrl+Alt+O on Windows. Figma turns the stroke into a vector path (Figma help: convert strokes to vector paths). Without this, a line icon can come out empty or misshapen.
- Flatten the shapes inside each icon. Select the layers inside the icon frame (not the frame itself), then right-click and choose Flatten, or press Option+Shift+F on Mac or Alt+Shift+F on Windows. Figma merges them into a single vector layer (Figma help: flatten layers). This also turns rectangles and ellipses into paths that UIXport can read. Keep the frame, at a whole-pixel size such as 24×24 with no fill, and select the frames when you compile. Flattening the frame itself removes it, and the icon loses its box.
- Keep whole-pixel frame sizes. A 24×24 frame is fine. A frame such as 23.5×24 may not fit correctly, because the
viewBoxis then not whole numbers. - Name each layer. Class names are built from layer names, so "search" becomes a class you can find later. Names are lowercased, and spaces and symbols become underscores, so "Arrow Left" becomes
.ex-icon-arrow_left. Give every icon a unique name, and rename before you compile.
UIXport shows the same reminder in the plugin: "Ensure icons are structured cleanly as vector shapes."
Compile the font, step by step#
Compile#
- Select the icons. Select each icon frame or layer on the canvas. With nothing selected, the tab shows No Frames Selected.
- Open Dev tools. In UIXport, click the Dev tools tab. The panel is titled Developer handoff.
- Choose Icon Font. In Tools, click Icon Font. The Font options card explains what will be compiled.
- Compile. Click Compile Icon Font. The button shows Compiling Font... while UIXport exports each layer as SVG, merges its paths into one glyph and adds it to the font.
Check and download#
- Check the result. Look through Compiled Glyphs and the CSS under Font CSS Integration. Use Copy CSS if you only need the rules.
- Download. Click Download Font ZIP to save
icon-font-assets.zip. It holdsUIXportFont.ttfandUIXportFont.css. - Update later. If you change an icon in Figma, click Re-Compile. That is a new run, and it is free too.
What is in the font#
- Format: TTF only. The family name is
UIXportFont. - Metrics: a 1000-unit em. Each icon is fitted to 800 units and centred, so icons drawn in different frame sizes come out at a matching size.
- Code points: your icons start at U+E001 and go up by one per icon. That range is the Unicode Private Use Area, where code points have no standard meaning (Unicode FAQ: private-use characters). Your icons will not clash with real letters.
- Placeholder glyphs: the font also contains 62 capsule-shaped placeholder glyphs for A to Z, a to z and 0 to 9.
- CSS: an
@font-facerule, a base.ex-iconclass, and one.ex-icon-{name}::beforerule per icon that sets its code point ascontent.
Use it on a website#
Link the CSS and add the classes#
Put both files in the same folder. The CSS points to UIXportFont.ttf by a relative path, so they need to stay together, or you need to edit the url() in @font-face.
Link the stylesheet, then add both classes to an empty element. Copy the exact class name from UIXportFont.css:
<link rel="stylesheet" href="/icons/UIXportFont.css">
<button>
<span class="ex-icon ex-icon-search" aria-hidden="true"></span>
<span>Search</span>
</button>Accessibility and hosting#
- Hide decorative icons from screen readers. MDN's page on
aria-hidden="true"lists decorative icons as a use for it and shows the same pattern: a hidden icon next to a visible text label (MDN: aria-hidden). - Serve the font from your own domain. Font files must come from the same origin as the page, unless the server allows them through CORS (MDN: @font-face).
Optional: add WOFF2#
web.dev recommends WOFF2 for web fonts because it compresses best (web.dev: font best practices). UIXport only writes TTF, so convert it with a separate font tool if you want WOFF2, or use a generator plugin that writes it directly, such as the one in the best Figma plugins for developer handoff. Then add it to the src list with format("woff2"), which MDN lists alongside format("truetype").
Limits and tips#
- TTF only. No WOFF, WOFF2 or SVG font comes out of the plugin.
- One colour per icon. Glyphs take the text colour. Use SVG for multi-colour icons.
- Fixed family name. The font is always called
UIXportFont. You can rename it in the CSS, as long as the@font-facerule and the.ex-iconclass use the same name. - No quota. Compile Icon Font and Re-Compile are free with no cap, however many icons you select.
- Runs locally. The font is built with opentype.js inside the plugin. Your icons are not uploaded.
Related tools and guides#
- Icon font generator: specs and FAQs for this tool.
- CSS sprite: a PNG sprite sheet with CSS classes, from the same Dev tools tab.
- Picture tag: responsive
<picture>markup for images. - UIXport vs Figma's native export: what Figma exports on its own.
Build your first icon font#
Install UIXport from Figma Community, select a few clean icons and click Compile Icon Font. It's on the Free plan, with no cap.