Responsive lettering: scalable, interpolating vector shapes that can make themselves fit in a range of rectangles.
The python code consists of a couple of scripts to generate the SVG needed for responsive lettering. These are also included in the RoboFontExtension. All scripts are for RoboFont.
The www/ folder contains a working example. As it is loading .js and .json files it might be necessary to serve the files from a real server. When everything works it should look something like this.
The www code depends on
- jQuery, but probably not a very specific version
- snap.js, a very handy library for manipulating SVG data.
All the vector data comes from json, so in theory it might be possible to rewrite all this without snap.js.
The RoboFont extension is a useful tool for previewing and exporting vector work in a UFO to mathshape data. It can also be installed director from RoboFontMechanic.
Version 1.7 introduces a simple export to designspace with separate master UFOs, which is useful if you want to generate a variable font from the data using Batch. The exporter makes some assumptions about the glyph names in the source file. These are valid glyphnames (depending on the model):
- narrow-thin
- wide-thin
- medium-thin
- narrow-bold
- wide-bold
The script checks the font.lib entry
at com.letterror.mathshape.designspace
for information about the designspace topology. If you worked from a template generated with this extension then the settings are probably right. If there is no entry in the lib the script assumes a twobytwo designspace.
twobytwo
: two axes, four masterstwobyone
: one axis, two mastersthreebyone
: one axis, three masters
Ideas and code very much in debt to Jeremie Hornus, Nina Stössinger, Andrew Johnson, Onur Yazıcıgil, and Nick Sherman.
The Responsive Lettering package is published under the BSD-3 license.