Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fontforge: Export a glyph to SVG with fontforge command line

Tags:

svg

fontforge

How to export a glyph (from its unicode) to SVG with Fontforge command line ?

I also need to specify the font size and keep the original margins it has in the font.

like image 675
DevonDahon Avatar asked Dec 20 '17 09:12

DevonDahon


People also ask

How do I add glyphs to FontForge?

Select Encoding > Add Encoding Slots and enter the number of the glyphs you want — in this case, 3. FontForge will add the same number of slots at the very end of the font, and you will be moved there in the font chart.

How do I remove a glyph from FontForge?

In the main menu hit "Edit -> Select -> Invert Selection" to have all the unused glyphs selected. now we can run in main menu "Encoding -> Detach and Remove glyphs" to remove all the selected (unused) glyphs.

How do I import SVG into FontForge?

If you use Illustrator or FreeHand you should probably chose “eps” if you use Inkscape you probably want to use “svg”. Then in FontForge, open the glyph slot where you want to add the glyph you just designed (by double clicking on it), and within that window select File ‣ Import.


1 Answers

You may have found your answer already, but I just had to do this with the latest build of FontForge. The old answer of this command:

fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' font.ttf 

From a command prompt didn't want to work on Windows10 (I assume a permission issue), but you could give it a try. A quick work-around is to do it via the GUI Execute Script.

  • Run FontForge (For Windows10 installed in the Program Files (x86) directory, you may need to right-click "run_fontforge.exe" --> Run As Administrator).

  • Open the font you want to export.

  • Go to File > Execute Script

  • Paste: SelectWorthOutputting(); foreach Export("svg"); endloop;
  • Select "FF" radial button.
  • Hit OK

It'll save to the FontForge folder (where run_fontforge.exe is located).

like image 179
Kyle K. Avatar answered Oct 19 '22 19:10

Kyle K.