While generating and editing svg-fonts with the Custom Stroke Font extension in Inkscape I found that my svg-fonts could not be processed by the Hershey Text v3.0 extension. Also Fontforge claimed it to be corrupt. Here are the lessons I’ve learned and solutions I have found.
Avoid space in filename
If you name your font with spaces, this will be the default name of your font when generated with the Custom Stroke Font extension. That is not accepted by the Hershey Text v3.0. Just change the filename.
Convert to UTF-8
Updated 12.01.2021: This is no longer a problem with the newest version on Custom Stroke Font extension.
In my experience the svg-font files generated with the Custom Stroke Font extension will not be accepted by the Hershey Text extension nor FontForge if there is some special characters in the metadata or glyphs. Thanks to Windell Oskay (the father of the Hershey Text tool) for resolving that this is due to incorrect encoding of the svg-files. One way to fix this is using Notepad++ and select, from the Encoding-menu, “Convert to UTF-8” and save your file.
Split the xml-tags into lines
This is not needed for Hershey Text nor FontForge, but I’d like my files to look tidy. When you open your svg-font generated with the Custom Stroke Font extension in Notepad, the xml-tags are all on one line. This is not easy to work with (if you will or need to do that with the next steps). An easy way to split the code into lines is to open the file with Notepad++, open the search/replace window and search on > (end of tag). Replace with >\n (end of tag + newline). You need to use the extended search mode like on the print screen below (in Norwegian, but I think you get the idea).
Move metadata up
The Custom Stroke Font add the metadata tag to the bottom. This does not bother Hershey Text nor FontForge (as far as I know it is ignored), but I’d like it in the beginning of the file. Just move the metadata block right before <defs> and add information about the origin and the licensing of the font.
Fonts that I have edited or created with this method