- Podcasts
- Talk Python To Me
- #47: Python in Typeface and Font Development
#47: Python in Typeface and Font Development
Talk Python To Me
- February 23, 2016
- 45 min
- Episode 47
About this episodeSee the full show notes for this episode on the website at talkpython.fm/47
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
#47: Python in Typeface and Font Development
This week on Talk Python To Me, we'll dive into the world of typeface and font development. Even though we spend our days immersed in fonts, from computer interfaces, signs, books, televisions, and more, much of the process and thinking about fonts is invisible to us. If we did dig into font development, we'd see that Python is a key component of the Font Developers Toolkit.
Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via at Talk Python.
This episode is brought to you by Hired and SnapCI. Thank them for supporting the show on Twitter via at Hired underscore HQ and at Snap underscore CI. Hey, everyone. I have a great conversation with Jost on Tap today. But before we get to that, I want to give you a quick update on my online course project.
Recall from last week, I announced I'm starting work on a large set of online training courses for Python. You can read about the whole story on my blog post, which I'll add to the show notes. To launch this project, I put the first course, an intro to Python course called Python Jumpstart by building 10 apps, on Kickstarter.
The campaign has been out for a week, and the response has been amazing. The Kickstarter was funded in 12 hours, met almost all of its stretch goals, and is still going strong. I want to say thanks to all of you who backed it. I know many of the backers are podcast listeners. If this sounds interesting, check out the course at talkpython.fm/course.
Now, let's hear from Jost van Rossum about fonts and Python. Jost, welcome to the show. Thank you. Thanks for having me. Yeah, I'm really interested to learn about how Python is involved with font development. This is something I knew nothing about, and one of the listeners, Chris Simpkins, sent me a message and said, oh, you have to have Jost on the show?
He's doing all these cool things with Python and fonts, and so I'm ready to learn all about it. Huh, that's cool. Well, font production is a pretty rare profession or field, so it's kind of a niche market for tools. I mean, there are many graphic designers and that group there are, there's a smaller group of typographic designers, and within that group, there's an even smaller group of type designers who are designing typefaces, which become fonts.
You know, I'm the younger brother of Guido, Guido van Rossen, the inventor of Python, as you know. We're about 10 years apart. He just turned 60. I will be 50 soon. But when I was 15, so this must have been calculating, 1981. This is like a pioneering time of home computers. Our dad bought a little Sinclair 81, a ZX81 computer, which I hooked up to your television.
The only thing you could do with that is to program it, and my brother had already been studying math and or computer science. I don't even know exactly, and he was working in that field. So, he wasn't living at home anymore, but he was close by enough to teach me the basics. Like, what do you do with such a machine?
How does, it was a variation of basic that computer did. So, I had a nice introduction of a relatively experienced programmer. Somehow, yeah, that fascinated me. I liked working with that at the age of 15. So, actually, I got into programming before I got into graphic design, a typographic designer.
How can we build tools to do all these things, right? Well, that is what happened later. While studying graphic design, I had an awesome teacher called Gerard Nortzey, who was a type design and calligraphy teacher. And he had a very open mind for technology. And, you know, at some point, I was still playing with that old computer when I was 18 and produced some experiments that I programmed.
Yeah. So, that's like back when, like you said, you had to program the computer to get it to do anything. That's before they had programs. And so, that's crazy. Yeah. But very cool. Right. How did that evolve into working with Python? I mean, obviously, your brother invented it, which is, you've got to be just so amazed at how that's going, which is cool.
Eric is the one of my generation, pretty much. And we were making fonts and exploring the technology. And Peter actually had been involved in the development of a font editor called MacIcarus or Icarus M. It was a MacIcarus version of the Icarus font digitizing software. He was really experienced with that stuff and actually had started writing another font editor.
He was never happy with the font editors that were out there. And so, he created his own stuff, well, several times, actually. And he is also a graphic designer that somehow accidentally got into programming without a formal training. So, we're kind of a small group of graphic people who happen to be programming.
They had a new generation lined up, which was a complete rewrite in C++. But the old version was written in C. And Peter from Blockland was playing – I'm sorry, I'm getting perhaps a little long-minded about this, if you want to interrupt. No, it's interesting, though, that you contacted this company.
And this was a commercial product at the time? Yeah. And then they gave you the source code to build an API. That's really interesting. Yeah, it was their obsolete version, pretty much, right? So, they had the new generation, which was much nicer and fancier and whatever. But they allowed us to use their old code base, not to publish the code base, but we were allowed to play with that.
And Peter initially started – he realized I wanted to hook it up to a scripting language. And he wasn't into Python yet. He tried AUK, which, well, it was awkward at best, I suppose. It's all in the name already. You knew it was a bad idea. Yeah, it's all in the name. Exactly. And somehow I had just gotten seriously into Python.
I think the first Python version I had on my computer was maybe version 1.2. And the first version that I did some serious work with, I think, was Python 1.3. I just looked it up before the interview. I think it must have been around 1995 when Python 1.3 was released. I think 1.4 became even better with a Mac support.
And so once that physically worked, which was pretty hard for us because we're not really programmers, once that physically worked, we could start making the connections, making the API indeed, making Photographer scriptable. So that turned became Robofog, which was, well, minorly successful within a niche market.
We had some colleagues and friends in our business that really could use those features. We managed to build a little toolkit so you could build your own UI on top of that in pure Python. So people had a lot of fun with it and produced really useful tools for their production work, font production workflow.
This is a time when Unicode became more and more important. The international encoding standards. I should probably not have to introduce that for this audience. New type technology came about called OpenType, which came largely from Microsoft, but was a cooperation between Adobe and Microsoft, allowing all kinds of fancy typesetting stuff, but also non-Latin support for all kinds of languages that were not available for us simple font developers earlier.
So larger character sets, Unicode features, OpenType stuff, that was just no longer, it was not possible in Robofog. And we were pretty much at the same problem. I mean, it would pretty much require a full rewrite of Photographer to support those things that we needed. And yeah, we were kind of not up to that.
And he was actually looking or shopping around for a scripting language because he realized that that's indeed something that is needed within this kind of workflow. Again, that's a little sidebar. I mean, it's a very specialized profession, but there are not many people who are doing it at that high level.
So there's not a huge market. So like a company like Adobe, it's not interesting for them to develop a font editor at such a scale. Right. Maybe they'd make something like Illustrator. Exactly. But not really completely focused. So it sounds like you have these smaller companies written by one or two guys, right?
Exactly. And type designers are very, well, it's a specialized thing, but they're also very stubborn people. But you ask 10 type designers a question, you will get 10 different, they will not agree with each other, simply, especially regarding tools. So to have this editor that you can enhance or can script or automate or write plugins for is just the thing because people can just make their own stuff, right?
And Python is awesome for that because people with little or no programming experience can get into it relatively quickly. So that whole model proved for us pretty successful. So the Russian guy, Yuri Ramola, saw that and realized, yeah, Python is a cool language, easy to learn, and it's easy to integrate in C.
And I think his application was written in C++, but still that integrates pretty well. So he chose Python as a scripting language for that. Yeah. And he had a working example from Robofog as well. So he's like, let's just do that again over here, right? Yeah, exactly. But it was a cool thing because suddenly, I mean, we could use our own thing less and less because it was missing the features that we desperately needed.
In the late 90s. So he wrote an API for that. And actually, we weren't quite happy with the way he wrote that API because we were used to our way. So we actually wrote a whole library on top of his API. His API was a little low level. We wanted to have something more high level as far as scripting API is concerned.
We called that Robofab. I forgot where that name came from, but it must have been something pretty meaningless. Yeah. So we worked with that for better or for worse. I mean, it was at that time the only tool on the market at all that supported all the features we needed. So they were a bit in a monopoly position at the time.
Yeah. And that was another commercial product. Yeah. That's another commercial product. Roughly at the same time, I should have looked that up before the interview. I have written a library called Font Tools slash TTX. TTX is more like the tool side, the user end of the tool, which is a library that deals with several font formats, but mostly true type and open type.
And can read binary data. And also that's the TTX part. It can convert a whole binary font to an improvised XML format. It can be able to do that. So that's the two things that that library does, which was great for reverse engineering things, for fixing up things that editors, font editors didn't generate correctly to learn about the formats.
I think he's now doing some work for Google for true type auto hinting stuff. Adam Twardock, who's actually on the FontLab team. At the time, there was a small community of people who used that stuff. And actually, even for the non-programmers, non-programming type or font developers, they could use that tool to decompile fonts, peek and poke to the insides, and then compile it back to a working font.
So that was a pretty neat tool to have. And it's on GitHub now, is that right? Yeah, yeah, yeah. By now, it's maintained by Bedat. I can't pronounce his last name. He works for Google. So if you actually Google for font tools GitHub, you should end up at his repository. He kind of took over the maintenance together with a fresh young team of people.
In my professional life, I had less and less direct use for it. And the kind of things that I needed, it did in a fairly stable way. So I kind of backed out of developing it. I was kind of the, well, what do you call it? The maintainer that disappeared. The spark that created the project that other people ran off.
There you go. Right, yeah. So one thing I saw that you can do with that that's interesting and I wanted to ask you about is you said you can debug fonts. What does debugging fonts involve? What does that mean? Fonts is an interesting technology, fonts in general, because they are supposed to have a long lifetime.
People do not tend to upgrade their fonts. And they're still there pieces of software if you look at it. I mean, to an extent it's data, but there's actually some aspects of various font formats. You can really call it software. It is software. So, yeah, different operating systems and different applications have different quirks with respect to handling fonts.
Like a font may work in one application and fail in another. Well, if they're made properly, then they work everywhere, obviously. But that is not how the real world works. So there's this whole bunch of vaguely documented things. Like if you want your fonts to also work in Word from Windows 95, then you should make sure that that value in that specific table is set in this particular way.
Otherwise, it will not work. It's a whole bunch of legacy. I was going to say crap. I don't know if I can say that on your show. But it's really fairly chaotic. For instance, the TrueType specification is very well maintained by Microsoft these days. TrueType is an invention from Apple, and they maintain their own documentation.
So I don't run into them on a day-to-day basis. But the cool thing is, I mean, there are fonts that were generated by font editors 25 years ago, and they still work in some contexts. Maybe not everywhere. But like PostScript Type 1 fonts, I mean, yeah, on macOS, you can still install those old fonts, and they will work.
Well, it's limited, of course. They will have a small character set. People expect, especially graphic designers who actually buy fonts, right? So fonts are often a commercial product. They don't expect to have to upgrade their stuff every couple years like they are. Well, they are familiar with that with their applications.
I mean, Adobe pretty much pushes their InDesign and Illustrator upgrades. And, well, everyone knows the annoying Acrobat upgrade messages. Oh, yeah. So that stuff just doesn't happen in the font world as much. I mean, if people need new characters. Like an interesting time was when the euro was introduced in Europe.
Suddenly, well, the European Union had decided, well, hey, if U.S. dollars, they have a nice dollar sign. We have to have a sign for the euro. So they had this logo designed for the euro, which we now all roughly know. But initially, they thought it's really a logo that was formally specified with a compass and rulers and measurements.
And that's what we were supposed to use, not realizing that there is a different dollar sign in every font out there. So the font designers soon ignored the specification and just designed their own euro sign. But, yeah, all commercials, all fonts out there had to be upgraded to contain the euro symbol, which was a huge amount of work, which cost the font industry a lot of money.
But I think there was also some opportunities there. So those relatively ridiculous stories are fairly common in the font world. Yeah, that's, I guess I never really thought about it, that new symbols appear and you need them to show up. With every update of Unicode, we look a little bit like, okay, are we really going to support that?
Then suddenly math people decided that there is a bold variation of lowercase letters that are semantically different from regular. So they need their own Unicode code points in Unicode. So suddenly there's a whole set of lowercase letters or maybe even capital, I don't know, that are just bold because math people want that.
This episode is brought to you by Hired. Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities. Each offer you receive has salary and equity presented right up front, and you can view the offers to accept or reject them before you even talk to the company.
So another thing that is sort of related to the font tools is this thing called DrawBot, and that's more of a visual editor, right? Well, yeah. No, it's not directly related to the font part, but it's a little application for macOS that is pretty much a Python editor, and you run some code, and you can get some textual output, but also visual output.
And that was a very simple thing, maybe almost like Turtle Graphics. I forgot the details. He made a very nice book about it. Anyway, his students, Casey Reyes and other people, wrote processing, which became hugely successful. But I wrote this little thing called DrawBot, which is not really equivalent because it's very simple and primitive and much more 2D and vector-based.
We have a master program for type designers where people from all over the world come to The Hague and study type design for a year. So that's between 10 and 12 people who really intensively study type design. And the whole tool issue, we think tools are – digital tools are important to have control over.
So we want them to at least learn the basics of programming. Right. They're definitely not going to become professional programmers, but they should be empowered, right? Some people, indeed, you know, some people are just not wired for programming and they will actually struggle to get something going.
That's fine, too. And they still learn a thing or two. One student I should single out specifically, that is Frederik Berlan from Ghent in Belgium. Well, he had a decent math background, but really no programming background when he started studying with us. And he turned out to be super fast in picking up Python and making awesome stuff.
Yeah, but okay. But let's get back to Drawbots because it was a primitive tool that taught our students the basics of programming. But also there, I mean, I didn't really maintain it properly and it fell apart a little bit. And at some point, actually, Frederik picked it up and pretty much rewrote it almost from scratch, adding all sorts of new features, adding support that we can export animations and animated GIFs and a much nicer preview of the graphic output.
So that's been a lot of fun. It's been a great – that's the generation three. It's completely open source now. It's – I think the main site – drawbot.com is the main website. There is – the source is on GitHub. Unfortunately, it's a Mac-only application at the moment. We're still hoping that someone will at least pick up the drawing API and make cross-platform or Linux and or Windows versions of that.
So that's – because it's a simple drawing API. I'm not saying it's perfect, but it's small. And you can do cool things with it, with color and shapes and text even. Yeah, I've seen a lot of really cool pictures that people have generated within. They're pretty detailed. Yeah. Even fractal-looking things.
Right. Yeah, yeah, yeah. Well, you can write your loops in Python or even recursive things. People tend to pick that up relatively quickly. So it's been a really nice little tool for our type design students to get started with Python. And then they move over to do the serious scripting work for font editors.
Well, imagine developing a font family that has several weights or many weights, has to support many languages. So there are many characters in there. Well, then imagine all the European accented letters. There's a whole bunch of, it's just one example. Like there's a whole bunch of letters that are derived from normal Latin letters, but have an accent placed on them or several accents placed under them or on top of them or underneath them.
That's just going to take too long. And things have to be consistent within a font. So you can write tools that check certain things, metrics, whether certain things align or whatever. There's all kinds of things that you want to control or check or build in ways that can vary greatly from designer to designer to or could change from design to design.
And if you change the O, you want to obviously change all the sort of O derivative ones and you want to script that. So maybe as you're developing fonts. Yeah, well, that particular problem has actually been solved for a long time in a non-programming way, because indeed, that's a good question, but it's such a common problem that, in fact, in most editors, you can build a glyph referencing other glyphs.
Not the ones with aliens in them, but unified font objects, right? Exactly. Yeah, that's an interesting thing. This is a file format. Yeah, unified font object. It's also more or less an API if you want to deal with those files. It's pretty much it's actually me and my colleague Eric from Blockland started a precursor of this thing, because we lived in different cities and we were working on a font project together.
And we needed a way to share the glyph data. And we were actually using CVS. This is like early 2000s. I remember CVS. Remember that? That is like before Subversion. Yes. It was pretty awesome. It was a super old and clumsy version control system. But we decided we needed a version control system for our glyph.
So we defined a text format for glyph outline data. And, well, we put it in XML format at a single file under version control for each glyph. And that way we could cooperate on one font remotely. So this tool, which was made by and for programmers for code, we started to use for outline data, which was pretty nice.
But that idea kind of caught on and or people thought, hey, we could use that as well. And we teamed up with a guy called Tel Lemming in the U.S., who was at the time working for a small font company called House Industries. And the three of us went on and developed this a little more seriously with a place for meta info and all kinds of metrics data.
And we improved the glyph formats that would be more generally useful because it started as this ad hoc homemade. You know how all these things probably start. And still, yeah, we're amateur programmers and definitely not experienced in the specification of file formats. We pretty much winged it with some XML knowledge.
And in the end, it's a UFO file. It's not really a file. It's a folder or a directory containing a bunch of files. And you need this so that you can put it in version control and diff it and not have it always come to it, right? Yeah. That was the starting point. Actually, so we made an import-export tool for FontLab, the dominant font editor at the time.
So we needed a way to transfer data from FontLab, which used its own proprietary binary GU unspecified unpublished format, to Metrics Machine and other tools. So the UFO format was just the thing for that. So to just go back and forth between those applications because we needed FontLab to edit outlines and, well, we needed Metrics Machine to do the proper metrics editing.
I've seen it from the sideline. And it's, well, a lot of work. It's very tedious. It's very important work. I don't want to underestimate that. But it's not easy for us simple graphic designers, if I can put it that way. Yeah, I'm sure. When it gets down to that, you've got to, you know, exactly the right detail and so on.
Something fails, you can even debug it directly in the browser. With a one-click deployment that you can do from your desk or from 30,000 feet in the air, Snap offers flexibility and ease of mind. Imagine all the time you'll save. Thanks, SnapCI, for sponsoring this episode by trying them for free at snap.ci slash talkpython.
So, can you talk about what it's like to, like, create fonts for these embeddable web, like the WAF font type things, versus, say, print, versus computer screen? Is this all the same, or how do you think about that? I'm not that active in creating web fonts and stuff. I know roughly how this stuff works.
There are different philosophies. I mean, on the one hand, technology is always important for type design. And, like, even historically, this is a very interesting story that starts pretty much at Gutenberg, like how this whole invention of print and how that goes through analog typesetting systems through digital.
Well, it may become less and less relevant with screens getting better and higher resolutions. I mean, I'm looking at a retina screen here that I cannot literally, with my old eyes, distinguish the individual pixels anymore. Yeah. So, in some sense, maybe font design is getting a little bit easier than it used to be.
Oh, yeah. Or is that a controversial question? No, no, no, no, no, no. Well, tools are getting more accessible. But that's with all, like, you can give an amateur a high-end digital camera and they can make technical great, great photos. And there will be some talents who have a flair for that or natural talent for that and become great photographers.
That's the same pretty much. I think that's a fair parallel to my profession. But most of the time, people will work hard and have an education and learn about the basics, not only technical, but on a visual level, on a design level. Like what makes a font work well, especially in text sizes, for instance.
That is just not a simple thing that even if an amateur can relatively easily learn the tools, that will not allow that person to create a high-quality font easily. That's kind of an interesting thing. Yeah, there's a lot of non-obvious things that make it really different on reading something or how it's even – how easy is it for you to absorb, right?
Yeah. One of the favorite aspects of type design is the paradox. You're designing a group of shapes that are letters that are designed to be used in context and in different orders. So the set of shapes, they belong together, right? They have to work together. They have to form words and sentences and people need to read that.
So on another level, you have to make the letters as different from each other as possible. So that's kind of like this whole paradox that we try to balance in between. And it kind of totally depends on the application of your typeface. I mean, if you're designing a wild headline thing for the hippest magazine or flyers or whatever, then obviously you'll have a very different set of rules to work with than if you're designing a typeface for a newspaper that needs to use the paper as efficiently as possible.
So to cram as much text on there without becoming illegible. Yeah, that's really interesting. I've always appreciated fonts and being able to look at the screen and see – you can look at some and they're beautiful and others you'd rather not have when you're writing your paper or whatever when I was younger.
But then I watched the movie Helvetica. Have you seen that? Right. Yeah, yeah, yeah. That's an awesome movie. Oh my gosh. I have ten times as much respect for fonts and the history and the thought and the detail that goes into it. Do you like that show? It was a fantastic movie. And it actually has – I saw a lecture of the director of that.
I mean, it was very obviously popular within my field because, you know, it was the first big full-length documentary that really shows something – well, I don't know if it's really the first. But it was an important documentary for our field and I'm glad that it got out there outside of our field as well, that people saw it and learned something about that and make people realize what it is.
I remember a long time ago on a party, I think I was still studying, but I was already deeply into type design. Someone asked, type design? Isn't that something like macaroni design? So it's like, well, not quite, but that's indeed – yeah, but that was probably at a time where people in Word now, they know you have your font menu.
Everyone knows there's a font menu and there's stuff in there. But not everyone realizes that that comes from people who make those things, right? Yeah, and I didn't really appreciate the depth of thought that goes into these things. And so now when I'm looking at something and I really think about the fonts and how much must be behind it and I'm just enjoying working in it or reading it or whatever.
But most of my colleagues have switched to Sublime, which is apparently awesome. But within my frame of reference, VI and Vim and Emacs don't really exist. Yeah, those are definitely popular programmer choices for the main devs. TextMate, that's cool. Are you going to ask about tabs versus spaces or is that probably a done deal?
Are there any that you can think of? You're like, I just found this and I really love it and I should tell the world about it. Well, you know, I'm not a heavy user of external packages. But, I mean, I've been a longtime user of NumPy, which I have probably used like half a percent of its functionality.
I don't have a background in math. But like many of the features, the vector multidimensional array stuff is just super awesome. But I've recently, only for the first time I've heard of it for a long time, I've actually used some code from the SciPy module or package. Because it has some really neat, like triangulation algorithms and the Voronoi tiling algorithms.
Yeah, that's really cool. I suspect that most people that use those packages don't use all of it. Or I can imagine, even as a scientist, you probably have your slice that really applies to your problem, right? Probably, yeah. And then there's this whole plotting stuff that's in there that I'm not even sure if that works well within the environments that I use.
I use a lot of Mac-specific UI stuff. So, like, TK Inter, for instance, somehow not an option in my – I mean, technically it works on Mac. It's not a lovely UI experience, no. No, yeah. Somehow, you know, within my field still, I have mixed feelings about that. I don't want to be seen as an Apple fanboy at all.
But within my field, the Macs are so dominantly around. So, your tools have to support it, right? For the tools that we write, to not have Windows or Linux support is totally fine. Yeah, so I'm recording on a Mac as well. So, they're nice pieces of software. They definitely are. But actually, the Fontools library that I've been working on, that is completely welcome.
And people that listen to the show, they've written me recently and said, can we have, like, a conversation on how to do this well? Because it really is hard to do it, both cross-platform and nicely, I think. Exactly. I have no answer to that. I've seen nice results from Qt. I hear things about GTK, but I know nothing about it.
This has been another episode of Talk Python To Me. Today's guest has been Jus Tfendrassen, and this episode has been sponsored by Hired and SnapCI. Thank you guys for supporting the show. Hired wants to help you find your next big thing. Visit Hired.com slash Talk Python To Me to get five or more offers with salary and equity presented right up front, and a special listener signing bonus of $2,000.
SnapCI is modern, continuous integration, and delivery. Build, test, and deploy your code directly from GitHub, all in your browser, with debugging, Docker, and parallelism included. Try them for free at snap.ci slash Talk Python. Do check out the video course I'm building. The Kickstarter is open until March 18th, and you'll find all the details at talkpython.fm/course.
