Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!pacbell.com!tandem!zorch!xanthian From: xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) Newsgroups: comp.fonts Subject: Re: Types of kerning Message-ID: <1990Sep8.131312.23352@zorch.SF-Bay.ORG> Date: 8 Sep 90 13:13:12 GMT References: <38743@shemp.CS.UCLA.EDU> <4cac478e.20b6d@apollo.HP.COM> <1990Sep7.204316.26956@jarvis.csri.toronto.edu> Organization: SF Bay Public-Access Unix Lines: 73 avi@dgp.toronto.edu (Avi Naiman) writes: > >Although their approach is far from universally accepted, there are two >important aspects to note. First, it is EXTREMELY DANGEROUS for those >not trained in the art of typography (and don't think it's a science) >to hack together kerning tables. Aw, come on. It's not like you're going to start a nuclear war if you don't get it perfect or anything! >[This warning applies to MOST people >found on the net!] After the basic letterform shapes of a typeface (or >font -- i.e., a typeface's rendition at a specific size realized in a >specific medium) have been designed, a considerable amount of time is >spent tuning, re-tuning, and fine-tuning the spacing (and/or kerning). >To my knowledge, noone has yet found a satisfactory technique to determine >character spacing automatically (including Kindersley). Fudging it 'til it looks right is a perfectly satisfactory technique, and given automated assistance, can be quite effective. >The second aspect to note is that 'kerning' is basically an exception >handler. If the character spacing could be computed directly from the >shapes of a pair of characters (or all the characters in a word, line, >or even page), there would be no need to 'kern'. The question of optimal >(and automated) spacing remains an open research topic, and is best left >to qualified investigators working with competent typographers. But rather than wait around for the millenium, try the following: 1) Rasterize the font at some resolution sufficient to adequately represent the characters, but coarse enough to allow the rest of the computation to finish somewhat before the heat death of the universe. Since this is a "one time" calculation, be willing to invest some cpu cycles. 2) Overstrike each pixel in the rasterization of each character with a disk of pixels the diameter of a nice looking character spacing. Call the result a "fattened font" 3) To save computation time, extract the four-connected border of each character, call the result an "edge font". You don't need the interior borders, but it is probably easier to carry them along than figure out how to get rid of them automatically. 4) For each left-right pair of edge font characters, in a rasterized universe, starting at some sufficient separation, plot them step by step closer together on the baseline until at least one pixel double strikes; back off one pixel. 5) Take the result, + or - from normal spacing, as a first guess at kerning. Turn it into a "proportion of the character width" (or maybe x-height) kern factor. 6) Plot sheets of all possible left right combinations, fudge the kerns for the ones that still don't look right. 7) Plot sheets at a range of interesting point sizes, fudge the "track kerning" to separate the small sizes more in proportion to their size, the big sizes less. Adjust to taste. A cubic spline best fit through half a dozen hand adjusted cases will probably suffice for a curve for "all" point sizes. No incoming missiles? Then its probably good enough for all but the most incredibly fine quality work. Note that there may be a couple of pathological cases where this fails badly, like getting the hook of a j under the right hand stem of an x, where a collision might occur but clear up with tighter kerning. Thus the hand fudging after the automated first effort is a necessity. Kent, the man from xanth.