Back to News
Advertisement
oolliewagner about 12 hours ago 7 commentsRead Article on github.com

ZH version is available. Content is displayed in original English for accuracy.

I found myself reaching for SF Symbols' 'Copy Image As…' quite often during agentic design sessions, so I made a command-line tool that the agent can use by itself. It exports Apple SF Symbols as SVG, PDF, or PNG.

The vector paths come directly from macOS's symbol renderer. Internally it reaches a private ivar on NSSymbolImageRep to get the CUINamedVectorGlyph, draws into a CGPDFContext, then walks the PDF content stream back out as SVG `d` commands. The output matches what the system draws, rather than an approximation traced from rasters.

A few things about it:

- Every subcommand accepts `--json`, and `sfsym schema` returns a machine-readable description of the whole CLI. - Symbol enumeration reads the OS's Assets.car BOM tree, so the list of 8,300+ names stays current with macOS updates without a version table in the binary. - Each SVG `<path>` carries a `data-layer` attribute, so you can retheme in CSS without touching geometry.

It's been saving me a bunch of clicking. Please let me know if you have any other ideas for it.

Advertisement

⚡ Community Insights

Discussion Sentiment

100% Positive

Analyzed from 188 words in the discussion.

Trending Topics

#default#pdf#symbols#svg#apple#animations#question#having#let#every

Discussion (7 Comments)Read Original on HackerNews

raframabout 1 hour ago
> The default format is PDF.

Genuine question: what’s your use case for having a single SF Symbols icon as a PDF file? Let alone having that as the default? In my own experience, I’d want SVG nearly every time.

olliewagnerabout 1 hour ago
You're right. Just flipped the default to SVG on main. Honest answer: SVG wasn't fully working during early dev, so PDF was the working default and it stuck. Should've revisited.
difosforabout 3 hours ago
But these are copyright by Apple so are you allowed to use them on your commercial websites and apps?
olliewagnerabout 2 hours ago
Right, these are licensed by Apple for UI use on Apple platforms only. The README has a "Before you use this" callout up top about this. sfsym is an export tool; what you do with the output is on you.
ameliusabout 3 hours ago
For those wondering what SF symbols are:

https://developer.apple.com/sf-symbols/

This is not my iconset of choice, though.

tasoeurabout 5 hours ago
This is great! I found myself asking my AI agents to generate those icons every so often (esp. for websites), so thank you for taking the time to build this.

Quick question, are you also planning on supporting animations?

olliewagnerabout 2 hours ago
Thanks! I'm not sure how animations would translate into these exported formats. SF Symbols animations are typically state driven, and that doesn't really translate to a standalone SVG/PNG/PDF. You'd get something that autoplays on loop, or fires once. Let me know if you had something else in mind.