scribbletone / i-can-variable-font Goto Github PK
View Code? Open in Web Editor NEWTips for making variable fonts
License: MIT License
Tips for making variable fonts
License: MIT License
The README says: “Mac previewer (requires running a script to build the application)”. Actually, if you want, you also just take the pre-compiled binary. When using the app for the first time, use the right mouse button (or control-click) to confirm that you’re ok with opening an app downloaded from the Internet.
This might be caused at the TTX/FontTools side of things, but reporting it for completeness sake:
When I follow the instructions and dump the resulting font with TTX/FontTools, I get a nice varibox-VF.ttx
file. But when I want to compile this back to a font, I get:
~/code/i-can-variable-font/example messing-around★ 20:08:36
➤ ttx varibox-VF.ttf
Dumping "varibox-VF.ttf" to "varibox-VF.ttx"...
Dumping 'GlyphOrder' table...
Dumping 'head' table...
Dumping 'hhea' table...
Dumping 'maxp' table...
Dumping 'OS/2' table...
Dumping 'hmtx' table...
Dumping 'cmap' table...
Dumping 'loca' table...
Dumping 'glyf' table...
Dumping 'name' table...
Dumping 'post' table...
Dumping 'GDEF' table...
Dumping 'GPOS' table...
Dumping 'fvar' table...
Dumping 'gvar' table...
~/code/i-can-variable-font/example messing-around★ 20:08:43
➤ ttx varibox-VF.ttx
Compiling "varibox-VF.ttx" to "varibox-VF#1.ttf"...
Parsing 'GlyphOrder' table...
Parsing 'head' table...
Parsing 'hhea' table...
Parsing 'maxp' table...
Parsing 'OS/2' table...
Parsing 'hmtx' table...
Parsing 'cmap' table...
Parsing 'loca' table...
Parsing 'glyf' table...
Parsing 'name' table...
Parsing 'post' table...
Parsing 'GDEF' table...
Parsing 'GPOS' table...
Parsing 'fvar' table...
Parsing 'gvar' table...
ERROR: Unhandled exception has occurred
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/fontTools/ttx.py", line 398, in main
process(jobs, options)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttx.py", line 372, in process
action(input, output, options)
File "/usr/local/lib/python2.7/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttx.py", line 293, in ttCompile
ttf.save(output)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/__init__.py", line 216, in save
self._writeTable(tag, writer, done)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/__init__.py", line 654, in _writeTable
tabledata = self.getTableData(tag)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/__init__.py", line 665, in getTableData
return self.tables[tag].compile(self)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otBase.py", line 90, in compile
self.table.compile(writer, font)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otBase.py", line 674, in compile
conv.write(writer, font, table, value)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otConverters.py", line 391, in write
value.compile(subWriter, font)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otBase.py", line 649, in compile
conv.write(writer, font, table, value, i)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otConverters.py", line 391, in write
value.compile(subWriter, font)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otBase.py", line 623, in compile
table = self.preWrite(font)
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otTables.py", line 209, in preWrite
for item in self.Item:
File "/usr/local/lib/python2.7/site-packages/fontTools/ttLib/tables/otBase.py", line 557, in __getattr__
raise AttributeError(attr)
AttributeError: ('Item', 'VarData[0]', 'VarStore')
~/code/i-can-variable-font/example messing-around★ 20:08:53
➤
Heya,
Recent versions of fonttools ship with a shell command called "fonttools". Instead of invoking python fonttools/Lib/fontTools/varLib/__init__.py my.designspace
you can now just say fonttools varLib my.designspace
Hullo, thank you for making this. It's been really had to find easily understandable information about creating variable fonts, thanks for putting the time into this example. 💯
I did have an issue installing fontmake where I had to re-install pip because of TSLv1.0/1.1 pip issues that took effect in April, it's a little obscure for the readme, but just wanted to mention in case anyone else has this issue.
Mostly this isn't an official issue
just wanted to say thanks!
Typo:
fontmake -o rtf-interpolatable -m path-to-your-designspace-file
should be
fontmake -o ttf-interpolatable -m path-to-your-designspace-file
I followed the instructions on a Mac (El Capitan), some comments:
pip install fontmake
works as wellpython env/lib/python2.7/site-packages/fontTools/varLib/__init__.py path-to-your-designspace-file
is python /usr/local/lib/python2.7/site-packages/fontTools/varLib/__init__.py path-to-your-designspace-file
on (my?) MacSuperpolator substitution rules (http://new.superpolator.com/documentation/rules/) get lost somewhere between the designspace file and the generated v-font. Or perhaps the generated fonts are legit and the apps that currently support v-fonts just don't support that feature yet?
The rules do get lost at the moment. I need to add them to the designspace export, and then they need to be supported by varlib. FWIW, this feature is not yet fully supported in the FDK feature language either. I'm sure that will happen.
I'm looking for examples on how to best setup a .designspace so I can generate plain old instances as well as variable fonts. Fontmake seems to support the -o variable
switch to do the varLib fudging for you. I guess the tutorial can be updated to use it?
Thanks for mentioning my name with FontTools, and while I wrote a lot of the initial code, it's a true community effort these days, with major roles for @behdad, @anthrotype and @brawer. I didn't write a single line of code for varLib for example :)
The link for "Requires a browser that supports Variable Fonts" is currently not valid, since WebKit Nightly and Safari Tech Preview stopped supporting variable fonts on macOS (except on macOS 10.13 High Sierra beta). The best browser to link to now is Chrome Canary, which works on multiple platforms, but users also need to enable "Experimental Web Platform Features". Feel free to link to How to get variable fonts working in Safari, Chrome and Firefox, which explains the browser options.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.