Typophile

When would thin and hair spaces need to be breakable

D S0 votes

Are there any uses for thin or hair space where it wouldn't make sense for them to be non-breaking? I ask because I can't think of any, and the fact they aren't hard spaces makes them pretty unusable in reflowable text such as web. Why did Unicode not at least go with two equal sets of spaces, one of which would be non-breaking, instead of just a single non-breaking word space?

The intent of those were originally to do fine-tuning by hand on metal justified type and should not be breakable. Even in today's world of digital type they are still useful.

Can you give some examples for digital type?

They are great for any sort of groups of figures or letters, which are meant to be shown as a unit. Abbreviations, dates, large numbers, bank accounts, measurement units, mathematical equations …
You basically encode that the unit belongs together, but is just visually separated a little bit. And that’s why you don’t want it to break at the end of the line. Power Supply: 110
V

Also, they're needed in French to set some punctuation.
Anyway, I agree with inktrap: their default behaviour should be non-breaking. And that's how they work in InDesign, for example.
I don't know how Unicode encoded spaces are supposed to act.

Agree wholeheartedly with all the responses. They are very valuable as non-breaking. I cannot think of a non non-breaking use for them.

According to the Unicode Standard Annex #14, Line Breaking Properties, the following characters are in the class BA, which means there is an opportunity to break after, but not before.

2000 EN QUAD
2001 EM QUAD
2002 EN SPACE
2003 EM SPACE
2004 THREE-PER-EM SPACE
2005 FOUR-PER-EM SPACE
2006 SIX-PER-EM SPACE
2008 PUNCTUATION SPACE
2009 THIN SPACE
200A HAIR SPACE
205F MEDIUM MATHEMATICAL SPACE

That being said, the breaking algorithm (cf Example Pair Table) specifies that you may not break after a character in BA if it is followed by a character in one of the classes CL, EX, SY, IS, ZW and WJ.

EX contains the exclamation mark and the question mark; IS contains the semicolon. It appears that French typography is saved and does not need the narrow no-break space (U+202F; cf Unicode Notes on French). A consequence of the algorithm is that those characters may not be "unusable in reflowable text such as web" as you say.

Michael, that's all nice and well (although it still doesn't specify guillemets) but it doesn't work at least in Firefox.

You just forgot the semicolon ;-)
It’s & # x 2 0 0 9 ;

There is indeed a problem with Firefox. The following code appears to avoid it

Lorem ipsum dolor sit amet, ut decore postea
vituperata mel. Iriure timeam ius
e<span style="letter-spacing:.1em">i</span>; dolore
numquam ad qu<span style="letter-spacing:.1em">i</span>?
Mnesarchum sadipscing cotidieque pro id, ut vix scripta aliquid
mentitu<span style="letter-spacing:.1em">m</span>!
Et amet suas usu, zril honestatis dissentiunt nam at,
eu prima legimus
<span style="letter-spacing:.1em">«</span>vertere<span style="letter-spacing:.1em">m</span>»
nam. Nam ad odio accusamus.

It uses letter-spacing as I would use \kern with TeX. Some preprocessing would however be needed to get that as input text.

The intent of those were originally to do fine-tuning by hand on metal justified type and should not be breakable.

In the case of characters with a place in Unicode, a hairline space indeed should not be breakable, since it would be used for letterspacing - or for adjusting kerning (but that is not a "legitimate" use, because the font is responsible for getting that right).

But when a hair space was used in metal type, it might well have been used to adjust the size of a breakable space between words. Not that text gets to reflow after it's set in metal, of course... but it means that the example given here seems to contradict, rather than reinforce, the point being made.

But this gets me to thinking of some possible pre-Unicode computer representations of text, in which a hairline space might have the same meaning as with metal type.

Let's think of an IBM Executive typewriter as a first step to a concrete example. It used a coarse 5-unit proportional spacing system; it had typebars, being an ordinary electric typewriter otherwise, not a Selectric.

The space bar had a little "2" printed on it, with a segment on the left side having "3" on it. The 2 unit space was the normal word space, the 3 unit space was a wider space which took up the same amount of space as a digit, useful for tabular matter.

The backspace key went back by only one unit.

So it didn't have a hairline space key that advanced by 1 unit; when justifying lines by a second retyping, one would have to remember the sequence 2, 3, 22, 23, 33, 223, 233, 333 to know what to type for the successive widths of spaces.

Thus, in a phototypesetter system where the unit system is hardcoded and fairly coarse, one could imagine a code that stands for a "one-unit space" which might be part of a group of several spaces, and the sequences of spaces as a whole might be either breaking or non-breaking. (Presumably this would be determined by the presence of a "justifying space" of variable width in the cluster, although a non-breaking justifying space is also useful - one doesn't want a non-breaking space to have to be at risk of winding up conspicuously narrower than the other spaces on the same line.)

I just checked that if we use <span style="white-space:nowrap">&thinsp;</span> instead of &#x2009; Firefox behaves correctly.

So it looks like there is still no simple, recommendable and bullet-proof solution for this on the web. :-(

U+202F would be the way to go in theory, but most fonts will not have it and the browser’s fallback results might be unacceptable.
The SPAN solutions do work, but they are just styling, not encoding. So they might not be preserved properly when copied and the people who edit the texts of websites often don’t even have the permissions or knowledge to write this stuff out in HTML/CSS.

Reasonable way of doing it would be to use normal non-breaking spaces and style their width in CSS. That way, when copying, or if CSS fails, people would still get the non-breaking space which they already use and expect in those situations.

Lorem ? Ipsum.

Lorem<span class="thin">&#160;</span>? Ipsum.

.thin {
display: inline-block;
width: 0.125em; /* 1/8 em */
}

Ellipses and consecutive quotation marks could just be wrapped in spans and tracked, 'cause people usually don't write them with, or expect, spaces inside. (If you also do it that way in InDesign with a tracked character style, you can map it to a classed span when exporting to HTML or EPUB.)

Lorem, “ ‘Ipsum’ dolor” sit amet . . . ?

Lorem, <span class="ls-punct">“‘</span>Ipsum’ dolor” sit amet <span class="ls-punct">...?</span>

.ls-punct {
letter-spacing: 0.125em;
white-space: nowrap;
}

Captured from web.archive.org on 20 May 2017. view this capture