Extract SVG paths from font glyphs on macOS.
./build.shExtract SF Symbols by name from SF Pro Text:
./build/bin/glyphsvg heart bold 768 --output=heart.svgArguments: <name> <weight> <size>
Weight selects the SF Pro Text font variant. Valid weights: black, bold, heavy, light, medium, regular, semibold, thin, ultralight.
Extract Material Symbols by name from Google's variable fonts. First fetch the fonts and codepoint maps (one-time, not committed to git):
./material/download.shThen extract by name:
./build/bin/glyphsvg --material home 256 --output=home.svg
./build/bin/glyphsvg --material=rounded settings bold 256 --output=settings.svg
./build/bin/glyphsvg --material=sharp star 256 --weight=600 --output=./icons/
./build/bin/glyphsvg --material favorite 256 --fill --output=favorite.svgArguments: --material[=<style>] <name> [<weight>] <size>
- Style (part of the flag):
outlined(default),rounded,sharp. - Weight is optional. Give an SF Symbols-style name positionally (
ultralight,thin,light,regular,medium,semibold,bold,heavy,black) or an explicit numeric value with--weight=<N>. Both map onto the font'swghtvariation axis (clamped to Material's 100–700 range;heavy/blackclamp to 700). Defaults toregular(400). - Fill via the
FILLvariation axis:--fillrenders the solid variant, or--fill=<0..1>a partial fill. Defaults to outline (0). - When the output is a directory, the file is named after the symbol (e.g.
home.svg).
The tool locates the downloaded data in material/ relative to the executable.
Override the location with the GLYPHSVG_MATERIAL_DIR environment variable.
Extract glyphs from any installed font using character input or codepoint:
./build/bin/glyphsvg --font=Helvetica "Hello" 100 --output=./output/
./build/bin/glyphsvg --font=Helvetica U+0041 100 --output=A.svgArguments: --font=<name> <characters|codepoint> <size>
Codepoint format: U+XXXX or 0xXXXX
--output=<path>specifies output file or directory (a trailing/or an existing directory is treated as a directory)- If output is a directory, each glyph is saved as a separate file. The name is
the symbol name in material mode (e.g.
home.svg), or the codepoint otherwise (e.g.U+0041.svg) - With no
--output, a single glyph is written to stdout - When extracting multiple characters, you must specify an output directory