[comp.sys.mac.system] TrueType versus ATM

ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) (03/20/91)

I've been doing some rough speed tests to see how TrueType compares with
Adobe Type Manager 2.0.

For my tests, I created a HyperCard 2.0 stack with a single text field and
a single card. I filled the field with about 760 characters (repetitions
of "The quick brown fox..."), selected the entire contents of the field,
and then checked out what happened on different choices of text font
and size.

My machine is a vintage Mac II running System 6.0.7. I've got the
TrueType versions of Courier, Helvetica, Symbol and Times installed,
while ATM handles the imaging for Avant Garde, Bookman, N Helvetica
Narrow, New Century Schlbk (sic), Palatino, Zapf Chancery and Zapf
Dingbats. The ATM cache size setting is its default 96K, with "preserve
line spacing" enabled. I have the 68020/68881 version of ATM loaded.

I should point out that all my timings are pretty rough, since they're
based on the seconds display on my wristwatch, and estimating half
seconds. But the differences in speed I observed I can definitely
vouch for.

The first time I chose a new ATM font, it took about 3 seconds to
redraw the text in the new font. For TrueType, this time was about
1.5 seconds. The update appeared all at once, which is probably
because HyperCard does the initial drawing off-screen.

Having chosen a font (initially in a 12-point size), I then changed
the text to 13 point, and then 14 point, 15 point etc. Changing
from 12 to 13 point invoked the same delay: 3 seconds for ATM,
1.5 seconds for TrueType. Subsequent changes showed a different
behaviour: TrueType kept updating at the same rate, while ATM started
updating in only a fraction of a second! It looks to me like ATM has
some kind of "lookahead" heuristic which says that, once I've used
two sizes of the same font, I'm likely to use a third.

I tried choosing a couple of other fonts for each of ATM and TrueType,
and observed the same behaviour in each case. Naturally, the second
time I choose the same font/size combination, the cache comes into
play, and redrawing goes a lot faster for both--in fact, there's no
difference in performance that I can discern in this case, nor is
there a loss of speed as compared to a bitmap font.

I haven't tried restarting my machine and redoing the tests a second
time, just to be sure. Would other people like to do their own tests,
and either confirm my observations, or show me up for
the dummy that I am?

I'm trying to get a discussion going here, so--comments welcomed...

Lawrence D'Oliveiro                       fone: +64-71-562-889
Computer Services Dept                     fax: +64-71-384-066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
To every glyph, kern, kern, kern,
There is a width and a side bearing, kern, kern, kern...

torrie@cs.stanford.edu (Evan Torrie) (03/20/91)

ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:

>I've been doing some rough speed tests to see how TrueType compares with
>Adobe Type Manager 2.0.

  So have I.  I've found one interesting thing.  Using Times, Truetype seems 
to be about 50% faster when rasterising the standard A-Za-z character set, 
but if you add in some of the special "option" characters, Truetype suddenly
starts rasterising noticeably slower than ATM.
  Is this just due to the more complicated nature of the special
characters, or is it that they haven't been optimised and tuned for
speed as much as the Roman characters?

  Also interesting is the memory requirement.  Truetype's cache
doesn't seem to be included in the System heap - at least it doesn't
show up in About the Finder as taking up anywhere near the same amount
of space as ATM with say, a 160K cache.
  Yet Truetype caches many more fonts on my 5MB machine than ATM does
in its 160K cache.  My guess is that Truetype is using temporary
memory?

-- 
------------------------------------------------------------------------------
Evan Torrie.  Stanford University, Class of 199?       torrie@cs.stanford.edu   
Where can a nation lie when it hides its organic minds in a cellar dark and
grim?  They must be ...  very dim.

gillies@m.cs.uiuc.edu (Don Gillies) (03/21/91)

I don't think speed comparisons are all that meaningful, for the
following reasons:

(1) Adobe's algorithm may indeed produce better 300dpi or
    180dpi results.  This is because adobe's font hints
    are just data structures, and the algorithm that makes
    use of these data structures is still proprietary and is
    still rumored to do a superior job of rasterizing fonts.
    Superior 180dpi and/or 300dpi results are probably what you 
    want in the long for a quickdraw printer driver.

(2) If ATM 2.0 does indeed use type-1 "hinting" to produce
    these improved fonts, then two different fonts may have
    completely different amounts of hinting, not to mention
    different amounts of total fill, and serifs, etc.  In my
    opinion, only similiar fonts (times - times, helvetica - 
    helvetica, etc) can be compared in a meaningful way.

-- 

newbery@rata.vuw.ac.nz (Michael Newbery) (03/21/91)

In article <1991Mar20.080055.26542@neon.Stanford.EDU> torrie@cs.stanford.edu (Evan Torrie) writes:
>ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
>
>>I've been doing some rough speed tests to see how TrueType compares with
>>Adobe Type Manager 2.0.
>
>  So have I.  I've found one interesting thing.  Using Times, Truetype seems 
>to be about 50% faster when rasterising the standard A-Za-z character set, 
>but if you add in some of the special "option" characters, Truetype suddenly
>starts rasterising noticeably slower than ATM.
Not just Times, the others show the same behaviour. I played with some
sample text I have which includes the entire Mac character set for a font
and noticed that it flew along until it got to the 'special' characters.
The slowdown only happens for characters with diacritics (a circumflex, e
grave etc), not for other 'option' characters. Strangely enough it even
seems to affect symbol for the characters in the same place as the
diacritics, although this might just be because most such characters are
'missing'.
This is on a 5MB IIci with Micron cache card by the way.
Given that the line layout manager is missing from 7.0, does anyone know
if the Times, Courier or Helvetica fonts shipped have any interesting
ligatures or swashes hidden away?

--
Michael Newbery<newbery@rata.vuw.ac.nz>
"Homer knew that the first thing to do on getting your chariot out
was to put the wheels on." John Chadwick--The Decipherment of Linear B

ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) (03/22/91)

In article <1991Mar20.193744.10870@m.cs.uiuc.edu>, gillies@m.cs.uiuc.edu
(Don Gillies) brings up a couple of objections to my comparative speed
tests of TrueType versus ATM:

 "(1) Adobe's algorithm may indeed produce better 300dpi or
      180dpi results.  This is because adobe's font hints
      are just data structures, and the algorithm that makes
      use of these data structures is still proprietary and is
      still rumored to do a superior job of rasterizing fonts.
      Superior 180dpi and/or 300dpi results are probably what you
      want in the long for a quickdraw printer driver."

It's true that Adobe's hinting scheme may have started out as
a pure data-driven design, with the actual hinting algorithms
hidden in the PostScript implementation. But it's no longer so
pure. Current versions of Adobe fonts do indeed contain procedural
PostScript code to implement some of the hinting--see Appendix 3
of the "Adobe Type 1 Font Format" book, version 1.1.
   Moral: a high-level, data-only hinting scheme may not be as
wonderful as you might think.
   As for the quality of Adobe's fonts and hinting versus that of
the TrueType font designers, I'll leave that to others to argue about
--for now.

 "(2) If ATM 2.0 does indeed use type-1 'hinting' to produce
      these improved fonts, then two different fonts may have
      completely different amounts of hinting, not to mention
      different amounts of total fill, and serifs, etc.  In my
      opinion, only similiar fonts (times - times, helvetica -
      helvetica, etc) can be compared in a meaningful way."

I'll concede that, in principle, you have a point. Something like
this did indeed cross my mind. However, since my timings were
consistent across different fonts--to within the accuracy that I
could measure--I'm inclined to believe that, for these common
fonts (corresponding to the ones built into current LaserWriters),
the difference is insignificant.

But I'm ready to be proved wrong. Enough talk--let's have some more
tests!

Lawrence D'Oliveiro                       fone: +64-71-562-889
Computer Services Dept                     fax: +64-71-384-066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
When you've been swimming in C for too long, you get brine-damaged.

odea@mars.jpl.nasa.gov (Andrew O'Dea) (03/22/91)

In article <1991Mar20.220011.18395@comp.vuw.ac.nz> newbery@rata.vuw.ac.nz (Michael Newbery) writes:
>In article <1991Mar20.080055.26542@neon.Stanford.EDU> torrie@cs.stanford.edu (Evan Torrie) writes:
>>ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
>>
>>>I've been doing some rough speed tests to see how TrueType compares with
>>>Adobe Type Manager 2.0.
>>
>>  So have I.  I've found one interesting thing.  Using Times, Truetype seems 
>>to be about 50% faster when rasterising the standard A-Za-z character set, 
>>but if you add in some of the special "option" characters, Truetype suddenly
>>starts rasterising noticeably slower than ATM.
>Not just Times, the others show the same behaviour. I played with some
>sample text I have which includes the entire Mac character set for a font
>and noticed that it flew along until it got to the 'special' characters.
>The slowdown only happens for characters with diacritics (a circumflex, e
>grave etc), not for other 'option' characters. Strangely enough it even
>seems to affect symbol for the characters in the same place as the
>diacritics, although this might just be because most such characters are
>'missing'.
>This is on a 5MB IIci with Micron cache card by the way.
>Given that the line layout manager is missing from 7.0, does anyone know
>if the Times, Courier or Helvetica fonts shipped have any interesting
>ligatures or swashes hidden away?
>
>--
>Michael Newbery<newbery@rata.vuw.ac.nz>
>"Homer knew that the first thing to do on getting your chariot out
>was to put the wheels on." John Chadwick--The Decipherment of Linear B

[theorizing on]
Maybe Truetype is only rasterizing the "normal" portion of the character set
initially.  Characters that aren't normally used get rasterized later.  That
might explain the speed difference between Truetype and ATM, as well.  Assuming
that ATM rasterizes the entire character set when it creates a bitmap.  Anyway,
that is my theory.
[theorizing off]

Andrew O'Dea, odea@kelvin.jpl.nasa.gov