sfsymbols is a quick-and-dirty command-line tool to export the shapes inside the SF Symbols font.
Open the Package.swift and build the project, then run the resulting sfsymbols tool from the command line.
There are several options you may specify:
-
--font-file: An path to a specific SF Symbols ttf file. If you leave out this argument, thensfsymbolswill attempt to locate an installed copy ofSF Symbols.appon your machine and use the font packaged inside there. -
--font-weight: A specific font-weight to use for exporting symbols. Valid values are:ultralightthinlightregularmediumsemiboldboldheavyblack
If you leave out this argument, then
regularwill be used. Also, depending on the specified--font-file, not all copies of the SF Symbols font may contain all weights. -
--font-size: The size (in points) to use when exporting symbols. If you leave this argument out, then the default size of44will be used. -
--symbol-size: The size of the shape to use. Valid values aresmall,medium, andlarge. The default value islarge. -
--output-folder: The folder where exported shapes should be created. Defaults to the current working directory. -
--format: The format in which you'd like shapes exported. Valid values are:ios-swift:UIBezierPath-based code in Swiftios-objc:UIBezierPath-based code in Objective-Cmacos-swift:NSBezierPath-based code in Swiftmacos-objc:NSBezierPath-based code in Objective-Csvg: SVG filespng: PNG imagespdf: PDF imagesiconset: AnSFSymbols.xcassetsbundle of 1x, 2x, and 3x PNGsiconset-pdf: AnSFSymbols.xcassetsbundle of vector PDFs
The default value is
svg.
This is posted mainly as a proof-of-concept. Use it at your own risk.
It is your responsibility to make sure you are following the terms and conditions of using Apple's symbols. For more information, see https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/.