Back

Kerning, the Hard Way

232 points2 monthshome.octetfont.com
seumars2 months ago

Funnily enough the example given of good “L” and “T” kerning in the word SALTY is badly kerned, the letters are kerned too close to each other. The classic trick is to look at 3-letter groups at a time, one word at a time.

Hackbraten2 months ago

It’s a deliberate design decision because of the stripes:

> The pattern of vertical stripes means that kerns can only be a multiple of the stripe repeat (not quite true, and i have sketched out more general versions of this, but it is true for this font).

gundmc2 months ago

I thought so too, but now if I look it seems as if every letter is just under two stripes with from its neighbor?

eviks2 months ago

This doesn't help much since visual perception doesn't depend just on this distance

beezlewax2 months ago

It's more of an artform than a science as I think different people perceive this differently

hinkley2 months ago

I worked on a project that was using shades of grey for everything before we hired a designer. It was terrible and illegible and designed by our boss who I’m am entirely convinced has aphantasia.

Someone started complaining that two pieces of text weren’t the same color. They were exactly the same color though. We’d built an entire UI full of optical illusions.

pixelfarmer2 months ago

This has a lot to do with framing in photography, architecture, and all these other things where "design" is involved that humans perceive as pleasing. It also means that not everyone has a knack for that. In return, chances are good that there are ways to actually "calculate" it. One well known example: The golden ratio that shows up in many designs, architecture, framing etc.

hinkley2 months ago

And the HN font on Safari puts the TY too close together IMO.

Look at them touching. Gross.

russellbeattie2 months ago

I can't help but point out that as someone who went to college for journalism and graphic design in the early 90s, and had to lay out galleys using strips of words and a razor blade, let me assure this isn't the hard way. Correcting a missing apostrophe or manually adding a hyphen while not throwing off an entire line requires both an eye for kerning and a steady hand.

Get off my lawn.

stavros2 months ago

Oh yeah? You youngsters have it easy, you don't know what it means to have to throw away the whole tablet and start again when your chisel slips.

The Pharaoh was not amused, I'll tell you that much.

Someone2 months ago

Impostor! Clay tablets where written in wet clay, so you didn’t use a chisel and didn’t have to throw away the tablet when your stylus slipped. At worst, you’d erase the entire tablet, but you likely could erase a small part often tablet.

Many tablets even could be recycled after the pharaoh read them (could pharaohs even read?). https://en.wikipedia.org/wiki/Clay_tablet: “Cuneiform characters were imprinted on a wet clay tablet with a stylus often made of reed (reed pen). Once written upon, many tablets were dried in the sun or air, remaining fragile. Later, these unfired clay tablets could be soaked in water and recycled into new clean tablets. Other tablets, once written, were either deliberately fired in hot kilns, or inadvertently fired when buildings were burnt down by accident or during conflict, making them hard and durable”

hinkley2 months ago

But I thought a lot of the tablets we have were from trash piles and they seem to have typos. So who is the impostor here?

<grabs the top of your head>

Old Man Withers!?

nick34432 months ago

Try having your finger slip and smudge a buffalo drawing. You have to find a whole new cave to draw in!

crazygringo2 months ago

This is just masochistic.

Why would you even try to encode a striped background into a font? And then make kerning work? I don't even know what to say. "The hard way" indeed...

Backgrounds are backgrounds, fonts are fonts, and never the twain should meet...

skrebbel2 months ago

> Why

For fun

jedberg2 months ago

I literally read this headline as "keming the hard way" and thought it was the most clever title ever.

jedberg2 months ago

Oh I know. I’ve been thinking about keming for 30+ years. :)

stavros2 months ago

OK then I'm going to need an explanation of what was clever about it. It seems like it would just be reusing the meme, no?

AceJohnny22 months ago

lol ooops, missed who I was talking to ;)

badlibrarian2 months ago

The complexity comes from needlessly combining two separate things into one: a simple repeating background pattern and a typeface. It's a "serving suggestion" when really all that's needed is the corn flakes.

kevincox2 months ago

Yes, but if you are really picky you will want your background pattern to align nicely with your typeface. Sure, you can carefully try to ensure that each character is a multiple of some fixed unit and set your stripe size based on that. Then make sure that the start padding is correct. But every step of the way any differences in the text renderer and things like accessibility settings overriding font sizes will be working against you. If you want to use this on a website or any other medium that doesn't have a very strict and consistent rendering pipeline I can't think of a better way to do it than a font like this.

badlibrarian2 months ago

Highly stylized letters over a background traditionally utilize .png or .jpg technology. Not that this guy's attempt at writing a wingdings++ compiler isn't amusing.

hinkley2 months ago

Yeah this is something you do for a logo. And I believe today you’d probably see this done as SVG. Though whether you would build the font out of lines or use an existing font one letter at a time is probably an open question.

rasz2 months ago

Kerning, the super easy way straight from 1986 Atari ST: https://en.wikipedia.org/wiki/Calamus_(DTP)#Calamus_Intellig...

jasonthorsness2 months ago

Ha the font looks great; but this seems to be pushing the boundaries what fonts themselves were designed to support, definitely "hard mode". What is the intended use case?

LegionMammal9782 months ago

Classically, you'd do things like replace f+i with an fi glyph, or f+f+i into an ffi. Though I'm surprised that it can be used to split one glyph into multiple glyphs, then transform those glyphs again.

euroderf2 months ago

I've had the same idea for Finnish, where all-uppercase text has some really ghastly kerning issues, like YT and VY and KY and (gack!) LJ. I hope to see a font RSN.

layer82 months ago

Isn’t kerning something that would be amenable to be approximately solved by machine learning? I.e. for a “good enough” default kerning? (Ignoring the extra difficulty from the stripes in TFA.)

shove2 months ago

Since it’s an issue of equalizing the perceptual area in the negative space, there’s not really any reason to throw ML at it. Throw actual math at it.

orbital-decay2 months ago

Human perception is highly non-linear and largely based on the concepts stored in the brain. Trying to manually approximate that with math is bound to fail once you approach certain fidelity threshold. If you look at the recent color science and spatial perception research, it becomes obvious that it makes total sense to mass profile the perception and throw ML at it. A lot of researchers are still in denial about this, though.

raphlinus2 months ago

Agree with sibling comments. There's something very slippery and tricky going on with "perceptual area," it's not simple geometry. This is actually an area where I think machine learning has something to offer.

scyzoryk_xyz2 months ago

Mrs. Scyzoryk is a typographer, confirms that it’s not just math, but can’t imagine using ML for what is an integral part of developing an „eye” and going through the process.

raphlinus2 months ago

Well, I have some qualifications in typography, a reasonable familiarity with ML techniques, and am fairly good at math (though I can't claim to have won the Putnam), and I can imagine how to apply ML for this task.

+2
stavros2 months ago
layer82 months ago

I would think that ML is exactly useful in developing an “eye”.

f30e3dfed1c92 months ago

There have been lots of attempts to automate kerning for decades. Most people seem to agree that they're still inadequate and that manual adjustments produce the best results.

oniony2 months ago

Would it have been possible to fix this by instead swapping out the LT pair with a ligature?

dzaima2 months ago

The GSUB lookups used are indeed the same thing that's used for ligatures.

shove2 months ago

I could have sworn that was where this was going in the first place

throwawayk7h2 months ago

Fonts should probably not do this. This would be better served as the font being what's in negative, and then the backdrop behind it being an unrelated graphical element, perhaps accomplished with css.

whatnow373732 months ago

I don’t see how the benefits of kerning, if any, outweigh the enormous costs.

Muromec2 months ago

It looks nice. When everyrhing consistently looks nice, thise small things accumulate into one apple.

exe342 months ago

it's one of many little things that add up to "oh your poster looks much nicer than the others" - but they can't put their finger on what exactly makes it nice.

keming2 months ago

Kerning lets letters be spaced more uniformly, which is easier to read for most of us.

It also allows letters to crowd each other like friends in a wacky group photo, a tree overhanging a sidewalk, or a cat's tail doing its weird contortions. Fonts are fun.

It’s worth the trouble I think, but there are options if you’d rather not support it.

dsp_person2 months ago

In my e-reader I changed the font to Roboto Mono and completely forgot it was monospace. It's not like reading feels any less efficient. Idk might even feel more efficient or comfy somehow.

MrMcCall2 months ago

Maybe there's an advantage to having each successive character appear perfectly rhythmically across the page.

What I want are two or even three shades for consecutive lines, to make it easier to transition from the end of the current line to the beginning of the next.

dsp_person2 months ago

Hmm can you explain? Would that be like line 1 starts out purple, transitions to light purple at the end of the line, and 2nd line starts light purple, transitions to pink, 3rd line starts pink and transitions to purple?

f30e3dfed1c92 months ago

The costs aren't enormous or anything close to it.

numpad02 months ago

sales

user39393822 months ago

Kerning the hard way would be to hardcode the “numberOfChars factorial/!” number of custom kerning distances.

ninkendo2 months ago

It’s not factorial, that’d be ludicrous… Rather it’s (n * (n+1))/2, which is similar to factorial but using addition instead of multiplication.(52+51+…+1) So a lot, lot smaller.

Dylan168072 months ago

Don't divide by two. Order matters.

And that +1 is going the wrong way so you might as well just say n^2.

ninkendo2 months ago

Oh, right, duh. Yeah it’s just n^2.

(If it was n+(n-1)+…+1, then my equation would have been correct, but you’re right, since order matters it’s just plain n^2.)

user39393822 months ago

Oh yeah, you’re only doing the pairs, you’re right

drpossum2 months ago

keming

PaulHoule2 months ago

I did a round of printing work two years ago which got me to notice (1) very few printed posters where people use serifed display fonts and (2) awful kerning by default with Microsoft and Adobe tools. When I did desktop publishing in the early 90s and early 00s I never noticed that kerning was so bad and wonder if I had bad taste back then or if it really got worse, like we can blame a patent troll for bad kerning -- I look at old books and see the r almost making love to the s next to it and think how much better it can be.

f30e3dfed1c92 months ago

I spent most of the 1990s and early 2000s working for a typesetting company whose work was college textbooks and monographs for academic presses. We applied modified kern tables to every single typeface we acquired. The tables from the font vendors were inadequate in various ways.

thesuitonym2 months ago

Back then, computers didn't really do kerning as well as they do now, and desktop publishing wasn't as common or affordable. Today, publishing tools are so easy to use, and the default kerning is usually good enough that most people won't notice a problem, or if they do, they often don't know it can be fixed.

JadeNB2 months ago

> When I did desktop publishing in the early 90s and early 00s I never noticed that kerning was so bad and wonder if I had bad taste back then or if it really got worse, like we can blame a patent troll for bad kerning ….

My suspicion is that there's always been bad kerning in most computer-generated text. Obligatory XKCD: https://xkcd.com/1015/

HeliumHydride2 months ago
adityaathalye2 months ago

Soon as I saw the headline, I was keming here to say the same thing. You beat me to the pumch.

Stratoscope2 months ago
aidos2 months ago

I love bad kerning more than most, but a lot of those feel like someone just put a space in the wrong place.

That’s a shame, I like my kerning to sit in that sweet spot where people don’t notice it but once you point it out it gives them an unsettling feeling wherever they see it.

keming2 months ago

> I like my kerning to sit in that sweet spot where people don’t notice it but once you point it out it gives them an unsettling feeling wherever they see it.

I’d love to see some examples of this.

unit1492 months ago

[dead]