[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Knuth on TrueType vs Metafont
Knuth on TrueType vs Metafont
Wed, 26 Jan 2000 07:39:05 -0500
don't know if you folks have seen this on
here's the relevant excerpt (see his last sentence if you are short on
Interviewer: Another similar issue is TrueType fonts. TrueType fonts
have this property of including instructions, computer programs
effectively, in the font, to do hinting.
Knuth: Well, I never met Elias or whatever.
Interviewer: Sampo Kaasila?
Knuth: I don't know. I know enough about TrueType to know that it's a
very intelligent design, that is similar to Metafont except that it
strips out everything that's slow. So the way the hinting is done is
by program, certainly. Of course, it came out maybe ten years after
Metafont, so probably something got through somehow.
There was the F3 font that Folio was making, if I can remember
the name, what the people in industry called it. Some of the people
that I had worked with on Metafont went into making font designs that
were similar to TrueType, but have not been successful.
Interviewer: There's a fairly major controversy with TrueType right
now, that there a number of patents that are owned now by Apple. It's
kind of interesting to me that that is the case even though it's for
the most part derivative work of what was in Metafont.
Knuth: I've been very unhappy with the way patents are handled. But
the more I look at it, the more I decide that it's a waste of time. I
mean, my life is too short to fight with that, so I've just been
staying away. But I know that the ideas for rendering... The main
thing is that TrueType uses only quadratic splines, and that Type1
fonts use cubic splines, which allow you to get by with a lot fewer
points where you have to specify things.
The quadratic has the great advantage that there's a real cheap
way to render them. You can make hardware to draw a quadratic spline
lickety-split. It's all Greek mathematics, the conic sections. You can
describe a quadratic spline by a quadratic equation (x, y) so that the
value of f(x, y) is positive on one side of the curve and negative on
the other side. And then you can just follow along pixel by pixel, and
when x changes by one and y changes by one, you can see which way to
move to draw the curve in the optimal way. And the mathematics is
really simple for a quadratic. The corresponding thing for a cubic is
six times as complicated, and it has extra very strange effects in it
because cubic curves can have cusps in them that are hidden. They can
have places where the function will be plus on both sides of the
cubic, instead of plus on one side and minus on the other.
The algorithm that's like the quadratic one, but for cubics,
turns out that you can be in something that looks like a very
innocuous curve, but mathematically you're passing a singular
point. That's sort of like a dividing by zero even though it doesn't
look like there's any reason to do so. The bottom line is that the
quadratic curves that TrueType uses allow extremely fast hardware
implementations, in parallel.
Interviewer: The question is whether that matters of course, now that
CPU's are a zillion times faster.
Knuth: But for rendering, Metafont was very very slow by comparison,
although I'm amazed at how fast it goes now. Still, it has to be an
order of magnitude better, and certainly that was a factor in getting
TrueType adopted at the time that it was, because machines weren't
that fast then. So TrueType was an intelligently chosen subset, but
certainly all the ideas I've ever heard of about TrueType were, I
believe, well known in the early '60s.
- Knuth on TrueType vs Metafont,
Shyjan Mahamud <=