Jump to content
Education typography videos. Check out our YouTube channel …

Spiro 0.01 release

Recommended Posts

raph
This topic was imported from the Typophile platform

Typophiles,

After years of talking about a spiral-based curve editing tool, the provisional patent application is filed, and I've made an unpolished release of the stuff I have now. Brave souls can check it out to see what I've been talking about. Others among you may choose to wait until there's a release that's not quite as spartan.

I made a Mac build, but loading and saving is more or less not implemented (you can kinda make it work using the commandline, but it really needs a file dialog). Background images (for tracing) are not supported yet either.

The solver has also not been tuned for numerical robustness, so when you play around with it, you'll often see it fail to solve the spline. It does work reliably when the pattern plate represents a real font shape rather than random points, though.

It's free software (GPL), and patches for improvements are greatly appreciated.

http://levien.com/spiro/

Link to comment
Toby

Great stuff, congrats! I see this as a better, more useful alternative to the sketch mode in Fontlab.

Link to comment
clauses

Great stuff! Should speed up a 'start designing directly on the computer' sort of a work process. Will it be compatible with UFO's or Fontlab files?

Link to comment
guifa

Great program. I did some quick sketching to figure out how it works. However on the Mac version I'm getting a few anomalies, though I'm not sure if it's Mac-specific or not (though they are pretty. They occur when I'm dragging points around, and and in drag randomly at certain points the design will "expload" into some of the forms you see below. If you need any help with the Mac OS X programming side I'd be willing to help out if you'd like.




«El futuro es una línea tan fina que apenas nos damos cuenta de pintarla nosotros mismos». (La Luz Oscura, por Javier Guerrero)
Link to comment
sgh

Congratulations on your release, Raph! Good luck with writing your dissertation---I look forward to reading the math behind these curves.

You might also want to mention on your web page that ppedit compiles on Linux (and from looking at the Makefile, probably Windows, too). For those who don't want to compile ppedit to try it themselves, let me describe the basics:

Curves are drawn with curve, corner, and tangent points as normal, but there are only on-curve points---no off-curve points. The shape of the interpolated spline can be changed by adding more points to the curve and then moving them. Moving a point added to a Bezier curve is a pain, because then all of the off-curve control points have to be recalculated to make the curve smooth. However, Raph's program recalculates the spline to be smooth as you move the point (this is made easier by using the Cornu spirals, from my understanding), so that you always have a smooth curve. It's actually more intuitive than I thought it would be, but it still takes some getting used to.

Link to comment
raph

Thanks for all the positive feedback!

@guifa: if you want to try your hand at adding open/save dialogs, that would be appreciated (currently, Apple-S just saves into a file called "plate"). Just make sure any Mac-specific code is bracketed by #ifdef X3_CARBON, so it doesn't break the Linux build.

The solver is known not to be numerically stable when the angles get big. If you stick with small angles, those pretty but unuseful spirals won't happen. I'm working on a more stable solver, but it's not ready yet. This stuff is rocket science, literally - the math I'm using is based on the calculus of variations, which has applications in computing optimal trajectories for spacecraft.

@hrant: Inconsolata was designed entirely using these spirals, as was Christian Gothic and pretty much all of my work-in-progress for the last year or so. The .plate files for Inconsolata are all posted.

On the Mac, you can open a .plate file by going to the directory containing ppedit.app, and typing "./ppedit.app/Contents/MacOS/ppedit u.plate". Obviously, a real Open dialog would be much more useful.

@sgh: the Windows port is started, but far from complete. I probably won't finish it myself, because I've lately become more interested in porting the code to a web app.

@clauses: I'm not able (due to time constraints) to do any of that kind of integration work myself, but would be happy to help others do so. In the case of Fontlab compatibility, for you to be able to edit interactively inside the app, they'd probably need to license the technology. A plug-in or a batch-mode converter could probably be done as a separate module, though, which would be compatible with the free GPL licensing terms.

And there's been talk of using the UFO format as a container for the curves, similar to the .plate file but in XML. (It's said that XML is for people who feel that Lisp doesn't have enough parentheses).

@jpad: I would love that, of course.

Because I'm starting at Google in a couple weeks, I won't be beating the bushes myself to push this technology out into the world. To a large extent, I'm "throwing the technology over the fence." It's an opportunity to see what the community can do with it, both in the free software world (it's being demoed today at LGM in Montreal), and whether users can generate enough interest and excitement to spur proprietary vendors to pony up for a license. It is my experience that companies tend to be extremely reluctant to do such things. I'd like to be proven wrong, but that's the main reason I'm taking a job in the advertising industry rather than trying to make a go on my own with technology licensing.

Link to comment
Dunwich Type

Well, I hope the people at inkscape see your work and consider adding it to theirs. Good luck at Google.

Link to comment
guifa

I could see a lot of nice things that could be in an OS X specific build. I'll take a look at the code when I get a chance and see if there's a way I can convert (or maybe it's already being done) the drawing view into an NSView. Once that's done, it seems you basically have everything you need to make a really sharp looking Mac app.

And hrant: those are too letters ... for my ... uh... dingbat font.

«El futuro es una línea tan fina que apenas nos damos cuenta de pintarla nosotros mismos». (La Luz Oscura, por Javier Guerrero)

Link to comment
clauses

Oh God I'd wish I could program. These new kinds of approaches to designing digital type on the terms of a digital process are needed. The way the hand could draw the 'right' curves on paper is lost in the Bézier approach. Combine what you are doing with something like Metafont and we would have something truly mindblowing. Ahh dreams.

Link to comment
abattis

@clauses: It is compatible with FontForge's SFD, and as Fontforge recently added python scripting and native UFO support, you should be able to pipe it through FontForge to UFO and to FontLab. Why you'd want FontLab at all is a mystery to me, though, since Spiro and FontForge is more than capable - just look at Inconsolata :-) Also, regarding MetaFont, I figure the way it goes directly from code to bitmaps is its biggest problem. If it went to (Spiro) outlines, that would allow a "dreamweaver" code/design view and workflow.

@guifa: Mac OS X only features would be a shame - I hope it will remain as cross platform as possible

@jpad: I was discussing Inkscape integration with the Inkscape developers at the LGM today and its definitely going in, although on a medium time frame - as part of the existing lib2geom efforts.

Link to comment
guifa

I didn't mean OS X only features per se. Only that I think it would be possible to encapsulate the spiral view into an NSView, thus making it no different to Interface Builder than an NSTextField. Again, I've not had a look at the source yet (I do plan on it tho) and so I'm not sure how separate you've got the different parts of the app, although if you're heading off to Google I'd imagine it's nicely modularised.

There are menu options for changing betwixt corner and curve points, etc. With those hooks, it could definitely open up some interesting possibilities if it can be made into a framework, which would still (I'd think) remain quite platform independent as well as make it more accessible to other developers for any number of other applications besides just font-design. If I'm rambling a bit excuse me, it is cinco de mayo (well, now it's seis de mayo).

«El futuro es una línea tan fina que apenas nos damos cuenta de pintarla nosotros mismos». (La Luz Oscura, por Javier Guerrero)

Link to comment
hrant

> Why you’d want FontLab at all is a mystery to me

Come on.

> regarding MetaFont, I figure the way it goes directly
> from code to bitmaps is its biggest problem.

It's not a problem if you see it for what it is: a combination of glyph descriptor and RIP. But a very real -and somewhat related- problem of Metafont is its foundation on the theory that letters should have skeletons. This is a naive, primitive and fatal fallacy, and one at the heart of chirography as well. It's the reason Computer Modern looks so crappy.

hhp

Link to comment
raph

@guifa: It's an HIView, which is almost the same thing as an NSView.

You'll find that the code is factored to be quite modular, but perhaps not quite in the way that you'd expect. Writing truly cross-platform apps is hard. If I didn't care about that, I'd have done this as a Cocoa app, in Objective C, using NIB's. As it is, the UI is built procedurally, and there's a layer (x3) which translates that into the code for Carbon or Gtk+2. (it could do Windows too; that's a Small Matter of Programming).

So, for example, the menu item for "delete point" is created thus:

x3menuitem(menu, "Delete Point", "delp", "<cmd>d");

The point is that you don't have to do redo all the UI work for each platform. An earlier version (see carbon_main.c) did load a NIB, and that was ok, but I like it better the way it is now.

@abattis: It is compatible with FontForge’s SFD

Not really. There's a batch-mode converter that spits out .sfd files. It's certainly doable to write a batch-mode converter for (cubic Bezier flavor) UFO's, or whatever FontLab accepts most natively. Given that FontLab is Python-scriptable, it should also be quite feasible to write a non-interactive import plugin that can be selected from the UI. In other words, an "import spiro plate" menu item.

There are different levels of compatibility. Batch-mode conversion is the lowest, interactive editing with lossless round-trip is the highest. If people seriously want to use these tools in production, anything less than that is a time-waster.

And as for FontForge, it kinda works for me, but there are lots of features of FontLab I miss, like stroke offset that isn't horribly buggy, Python scripting, a sane UI for OpenType contextual programming, etc. I've also had to fix a few bugs in it. Fortunately, because I am a rocket scientist, I can do that, but for most type designers, I think the experience will be less than fulfilling.

@hrant: problem of Metafont is its foundation on the theory that letters should have skeletons.

Metafont doesn't force you into that mode. The Computer Modern fonts are all defined as strokes, but AMS Euler is done more or less using the same technology as Adobe Type 1. Of course, Euler doesn't have any of the optical scaling or variation features either.

@clauses: The real power of Spiro comes out when you combine the spline fitter with techniques for variation. I have some ideas on this, which I will write up soon. My experiments thus far have been very encouraging, suggesting that it will be much easier to use than Multiple Master technology. Here's an experiment I did with linear interpolation of the control points to blend a weight axis:

The advantage of this technique is that all of the blends are guaranteed to have smooth curvature too. Using Beziers, in the general case, there's no guarantee of smoothness of any kind.

Link to comment
hrant

Metafont does support outlining and not just expanded strokes, but the only real reason to use Metafont is its parametric abilities, and (please correct me if I'm wrong) these only work with strokes. What would be amazing is if somehow we could use parametrics with outlines; even more amazing would be a GUI for that!

The variation angle you mention seems very interesting, although
I don't get exactly why spirals would be better at it than beziers.

> lossless round-trip

Do you really mean that?
1) I thought it can't be lossless.
2) It really only has to be one-way to be sufficiently useful.

hhp

Link to comment
sgh

@hrant: Metafont does support outlining and not just expanded strokes, but the only real reason to use Metafont is its parametric abilities, and (please correct me if I’m wrong) these only work with strokes.

MetaPost (essentially MetaFont for Postscript) supports outlines, and of course since everything is scriptable, parametric abilities are available to work with strokes. MetaType1 is a set of MetaPost macros that makes it easy to make a CFF-based font (Type1 or CFF-flavored OTF). My font Aurulent Sans is being developed using MetaType1. The use of a weight parameter can be seen when comparing the regular and bold weights.

What would be amazing is if somehow we could use parametrics with outlines; even more amazing would be a GUI for that!

The ability to script is much more powerful than just the parametrics, and GUIs aren't very good for representing scripts. If you're just interested in the parametrics, then it might be possible to represent them graphically, but here the main problem is that the dimension of the parameter space is probably too high to represent visually in a meaningful form.

Link to comment
hrant

> parametric abilities are available to work with strokes.

So has anybody designed a MetaPost outline font where the x-height is parametric?

> Aurulent Sans ... weight parameter

It's nice to see such an effort. The question is (and this might be difficult to answer) was it worth the effort, compared to a "plain" interpolation setup in FontLab?

> the dimension of the parameter space is probably too high to represent visually

Maybe I'm not getting you, but for a font that's meant
to be read the parameters can't really stray too far...

> The ability to script is much more powerful than just the parametrics

But FontLab has the former, but not the latter,
so the valuable sort of power is in the latter.

hhp

Link to comment
rosaiani

I like this a lot, this should be a great option to Bezier editing, hopefully it will make my s (no pun intended) look better!
Congratulations, and I think we are in front of the next Pierre Bezier right here...
Very honored cheers
Rodrigo

Link to comment
raph

@abattis: Python scripting got added to FontForge last week

That's seriously cool news. I can still imagine that most professional type designers would rather use FontLab though.

@hrant: > the dimension of the parameter space is probably too high to represent visually

Computer Modern has something on the order of 60 parameters for things ranging from the obvious ascender/descender height to more subtle things like the parameters for the serifs. That's a very high dimensionality of the parameter space, even if the amount of the change is subtle.

The key to making variation work for people who don't have advanced computer science degrees is to keep the number of dimensions down. Here's an outline of my ideas for that:

1. For optical scaling, use stroke offset for the bulk of the effect, with a little optional squooshing.

2. For things like ascender and descender lengths, allow points to be put on frames which can move independently of the main em. So, then, to lengthen descenders, pull the descender frame (global to the font) down.

3. For everything else, do interpolation. My gut feeling is that 2-dimensional interpolation (the corners of a quadrilateral) is the most that is intuitive to work with, and, if you can keep it to one, that's even better.

The number of active frames in any one glyph should be no more than three or so. The main thing interpolation is used for is weight (like the above image).

Also note that one of the most important aspects of optical scaling is the spacing and kerning. That can probably be done using simple interpolation between a "big" and a "little" size.

@rosaini: Thanks! Nice spirals in your avatar.

Link to comment
sgh

@hrant: So has anybody designed a MetaPost outline font where the x-height is parametric?

x-height is a parameter in Aurulent Sans, and I imagine it is as well in other MetaType1-designed fonts, such as Antykwa Toruńska, Antykwa Półtawskiego, Kurier, and Iwona.

The question is (and this might be difficult to answer) was it worth the effort, compared to a “plain” interpolation setup in FontLab?

To me, scripting the outline of a glyph is MUCH easier than drawing it graphically. I find it much easier to say "Put point A here. Put point B here. Put point C here. Put point D 1/3 of the way between B and C. Draw a smooth curve from A to D to E, etc". That way I don't have to worry about whether the curve is smooth or not, where to put control points, etc. (Well, that's a bit of lie, often I need to give MetaType1 a little bit more help, but not too often.) And if the width changes, or the x-height changes, then the position of point A, etc is automatically recalculated when the scripts are run again.

The ability to script is much more powerful than just the parametrics

But FontLab has the former, but not the latter,
so the valuable sort of power is in the latter.

I have never used FontLab, so I don't know its scripting language. However, based on your comment, it sounds like it is not as powerful as MetaType1. Can you do the type of outline construction I described above? The parametric power comes from using the parameters in the construction. Of course, it is also (somewhat) difficult to create construction scripts that capture parameters. See this discussion and this discussion for thoughts on why a more parametric approach has not been more frequently used.

Link to comment
hrant

> That’s a very high dimensionality of the parameter space

OK. Was that what Stephen was talking about? Also: assuming
the parameters don't interact (too much) couldn't one decide
to display/manipulate one or two at a time?

> x-height is a parameter in Aurulent Sans

Could we see how [well] it works out?

> based on your comment, it sounds like it is not as powerful as MetaType1.

What comment?
FontLab's scripting is Python, and everybody says it's plenty powerful.

What would be nice is to fold in parametric design.

> See this discussion and this discussion

The two links are the same.

hhp

Link to comment
sgh

@hrant: Was that what Stephen was talking about? (regarding high dimensionality)

Yes.

sgh> based on your comment, it sounds like it is not as powerful as MetaType1.

hrant> What comment?
FontLab’s scripting is Python, and everybody says it’s plenty powerful.

The comment I was referring to was:

sgh> The ability to script is much more powerful than just the parametrics

hrant> But FontLab has the former, but not the latter,
so the valuable sort of power is in the latter.

You seem to be saying that parametric design cannot be done with FontLab's scripting tools. As I mentioned, I have never used FontLab, so I have no idea what the actual capability is. Just because FontLab uses Python, though, does not mean that the FontLab Python interface allows the needed operations. Possibly more importantly, is whether the interface makes it easy to design glyphs parametrically.

Here's an easy test for someone who knows Python scripting in FontLab: given the parameters of width, cap height, left and right side-bearing, vertical stroke width, and horizontal stroke width, draw a sans serif uppercase H. Then draw an uppercase O. If this can be done easily, then FontLab scripting has the potential for parametric design.

The two links are the same.

Oops. The two links should have been this discussion and this discussion.

Link to comment
sgh

sgh> x-height is a parameter in Aurulent Sans

hrant> Could we see how [well] it works out?

What would you like to see?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Our partners

Discover the fonts from the Germany foundry FDI Type. A brand of Schriftkontor Ralf Herrmann.
Discover the Best Deals for Freelance Designers.
Get to your apps and creative work. Explore curated inspiration, livestream learning, tutorials, and creative challenges.
The largest selection of professional fonts for any project. Over 130,000 available fonts, and counting.
Support educational typography content and get access to a growing collection of exclusive content (like articles, galleries and font downloads).
×
×
  • Create New...

Important Information

We are placing functional cookies on your device to help make this website better.