# FontToSvgsToFont **Repository Path**: mirrors_brion/FontToSvgsToFont ## Basic Information - **Project Name**: FontToSvgsToFont - **Description**: Script for extracting svgs from icon font and script for reversing this process so edited svgs get slurped back into the font. Tested on Ubuntu. Requires FontForge. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Editing fonts can be hard and editing them with FontForge is an absolute UX nightmare. The purpose of this repo is to make it easy to convert a ttf font into a folder of svgs which can be edited/added/removed and then re-imported into the font. Because Svgs don't have awareness of font specific settings such as baseline offset, em size, glyph character mapping etc, the svgs extracted from the font are named in such a way to preserve this info. A file called font.json is also made to preserve some of the non-glyph settings from the font. In this way the extraction step is made reversible. Two scripts automate the Font to Svg and Svg to Font conversion: makeSvgsFromFont.py This converts a ttf font into a folder of svgs naming the svg files according to a naming convention which preserves respective glyph position, naming and character mapping. A "font.json" file is also created to store font specific settings. makeFontFromSvgs.py This rebuilds the font from the folder of svgs and font.json and also creates an html file referencing the rebuilt font for easier proofing. Note: you may need to close and re-open your browser to see changes made to the html file. Both scripts require FontForge. They have only been tested on Ubuntu. Usage: -Install FontForge. -Rename your ttf font file to "font.ttf" and place it in same directory as the script files. -Open terminal, change to the directory containing the scripts. -Run the command: fontforge -script makeSvgsFromFont.py This will extract a svg for each glyph in "./font.ttf" to "./svgs/" folder. It will also extract font settings to "./font.json" file. Svg's are named according to following convention: UNICODE_CHAR GLYPH_NAME LEFT_BEARING RIGHT_BEARING BASELINE_OFFSET.svg Example: "e950 MY_GLYPH 80 100 150.svg" This svg will be mapped to the font character e950 with glyph name "MY_GLYPH" and left bearing (padding) of 80, right bearing of 100 and will sit 150 above the baseline. Once you make changes to the svgs, font.ttf can be rebuild with this command: fontforge -script makeFontFromSvgs.py