From: pcg@aber.ac.uk (Piercarlo Grandi)
Newsgroups: comp.fonts,gnu.misc.discuss
Subject: Re: "Hinting" using antialiasing? A GNUish alternative...
Date: 27 Dec 92 21:39:08 GMT
	<freek.725305697@groucho.phil.ruu.nl>
	<1992Dec25.214916.10472@pasteur.Berkeley.EDU>
Reply-To: pcg@aber.ac.uk (Piercarlo Grandi)
Organization: Prifysgol Cymru, Aberystwyth

On 25 Dec 92 21:49:16 GMT, johnm@cory.Berkeley.EDU (John D. Mitchell) said:

johnm> The rasterizer is passing me things like "there's a line segment
johnm> from point (x,y) to point (r,w)" and I can draw the line on the
johnm> screen (or printer or plotter...).

This is close enough: what actually the rasterizer gets told is not that
there is a line/curve to draw, but more subtly that there is a countour
to be filled.

johnm> What's to stop me from optimizing the horizontal and vertical
johnm> lines and then using an anti-aliasing line drawing routine for
johnm> everything else?

Nothing -- I just wonder why nobody does it for outline fonts too.
Antialiasing is just as effective for outline fonts as for scaled
bitmaps.

Incidentally, if I remember well, in most/many windowing standards,
fonts can only be bitmaps (two colors). I think that's unfortunately
true of X11 too.

johnm> At some point the choice to light a given pixel in the character
johnm> box for the character over a pixel immediately adjacent becomes
johnm> arbitrary due to the physical device resolution

No, it is not arbitrary; if you do it arbitrarily then the bitmaps will
look "bad", because our vision is very sensitive to regularity of shape,
and other aspects of a character.  Thus for example hints that ensure
that two stems are the same width.

johnm> (i.e., I don't understand how this 'intelligent' bitmap scaling
johnm> filter system can produce output that is 'better' than hinted
johnm> fonts).

Not better looking, on looks I would think it would be equivalent or
nearly so; but better in speed and non proprietariness.

The argument is that manual hints are applied following an unconscious
filtering algorithm over the bitmap, one that maintains the regularity
of a character shape so that it looks nice. Now maybe a suitable
filtering algorithm can be found that has largely the same properties as
the unconscious one. There are moderately effective automatic hinting
algorithms, but I hope that a filtering one can cope better, that is
with greater generality, and reach nearly the quality of manual hinting
of outlines (which in many cases amounts to hand tuning of the output
bitmaps).

I think it would be more general because I guess it could be patterned
after the rather universal properties of human vision; instead some
hinting systems are patterned after the features of latin glyphs, and do
not adapt well to other styles of writing.

I could imagine for example that the same or nearly the filtering
algorithm that can be used to scale down a high resolution bitmap of a
chinese ideogram while retaining it essential features is much the same
as that for latin glyphs; moreover I think that storing ideograms as
bitmaps is easier and smaller than outlining them...

In a sense what I am really thinking is that after all a glyph is just
an image, rather than a gemetric figure, and whether it is a pictogram,
an ideogram or a character does not change the problem a lot.

While the outlining+hinting solution really is about considering a glyph
a geometric figure, that must be drawn on paper with different
griddings.

Well, I could add that I think that actually glyphs are a particular
type of image, with more regular feature than a real-life scene, and
with just two tones (even in pictograms color usually is only
decorative), and these particularities could be exploited (and indeed
are exploited in some laser printers with variable dot sizes that do
antialiasing and smoothing of low resolution bitmaps, with good effect).

My hunch is that scaling filters away high frequencies, and that a
coarse lattice introduces a very specific type of noise, and that human
vision is not equally sensitive to all frequencies in a character shape,
and is also not equally sensitive to all aspects of a character shape
(simmetry seems to be particularly important according to a bit of
e-mail I have received; I will post a summary). I wish I knew more about
signal/image processing and lattices.
--
Piercarlo Grandi, Dept of CS, PC/UW@Aberystwyth <pcg@aber.ac.uk>
  E l'italiano cantava, cantava. E le sue disperate invocazioni giunsero
  alle orecchie del suo divino protettore, il dio della barzelletta
Newsgroups: comp.fonts,comp.music