New to Typophile? Accounts are free, and easy to set up.
Hi everybody,
Is there a Python script that can batch import multiple EPS files in Fontlab. Searched all over the internet, and found nothing. I need just basic functionality - start from a new empty typeface and import EPS files in sequential mode, no encoding just in index mode. Any ideas! Thank you in advance!
7 Aug 2012 — 11:38am
This should get you started:
http://forum.fontlab.com/fontlab-studio/printing-glyphs-from-python/
7 Aug 2012 — 5:55pm
Not sure exactly how your EPS files are set up, but ScanFont works great for moving art from .ai or .eps files into FontLab. Unfortunately, it doesn't work on Mac running Lion or Mountain Lion yet. They do have options for those in that boat, though.
13 Aug 2012 — 4:16pm
This will ask you for a folder, find all ".eps" files in it and import them sequentially into the current font, using the basename of each file (without the ".eps" extension) as the glyph name. Should be enough to get you started, I hope.
#FLM: Import EPS glyphs from folder import os.path, glob f = fl.font folder = fl.GetPathName("Choose folder with EPS files...") pathmask = "*.eps" paths = [] for globmask in [pathmask, pathmask.upper()]: paths += glob.glob(os.path.join(folder, globmask)) paths = sorted(list(set(paths))) print "Importing EPS files from %s..." % (folder) for path in paths: basename = os.path.splitext(os.path.split(path)[1])[0] try: g = Glyph() g = g.LoadEPS(path) g.name = basename g.mark = 33 f.glyphs.append(g) print "%s.eps imported" % (basename) except: print "%s.eps IGNORED" % (basename) fl.UpdateFont(fl.ifont) print "Finished."13 Aug 2012 — 11:43pm
Thank you Adam! You are great! I will test it right away!
13 Aug 2012 — 11:49pm
Oh it works like charm! Thank you again!
16 Aug 2012 — 2:15pm
Vassil,
You needn't add to Adam's sense of self-worth: the jaunty hat says it all…
17 Aug 2012 — 7:44am
Oh Nick,
very deep inside, I am...
;)
19 Dec 2012 — 5:26pm
twardoch,
Can you explain how to use the script you posted? I want to batch import a bunch of eps files into fontlab, but I'm not sure how to use that script. Thanks for any direction you can give.
19 Dec 2012 — 5:27pm
frankrolf the link is broken :(
19 Dec 2012 — 5:27pm
Mark Simonson Scanfont runs as a WINE version, but I've tried several different EPS files and none seem to be able to import into the program.
19 Dec 2012 — 6:47pm
all you need to do is paste Adam's code into a macro window and hit the "run" button.
There's some instruction on basic script use in the manual, I believe.
Jason C
20 Dec 2012 — 4:24am
Thanks Jason, I got it to work.