Wednesday, June 2, 2021

For those who fuss over spacing

I had hoped that the non-breaking thin space would change everything.

Here’s an italicized word in parentheses: (test).

Ugly, no?

Here’s the same text with the addition of a thin space —   — before the closing parenthesis: (test ).

Better, yes?

But the thin space functions like an ordinary space. With the insertion of a thin space, characters that should stay together can end up split across two lines, like so: (test
).

That’s a faked example. But it does happen. You can guess how I know that.

Enter the non-breaking thin space —   or  . It’s slightly wider than a thin space, and it’s supposed to be, as its name suggests, unbreakable. But it breaks. You can guess how I know that too. Here’s what I saw as a Preview while working on an earlier post:

[That’s what I get for making a silly plural.]

I think that   and   are interchangeable, but I could be wrong. What I know is that they both break in Safari. So I’m still looking for a non-breaking thin space that does not break. And I’d like to know why the allegedly non-breaking thin space displays differently in macOS and iOS. On iOS devices, it’s indistinguishable from no-space.

[For collectors only: the ordinary non-breaking space is  . And if anyone wants to asks, “Who cares?” — I do.]

comments: 5

Richard Abbott said...

For your delight...
https://en.wikipedia.org/wiki/Thin_space
You are correct that HTML  ,  , and indeed   are all the same. And they are all not no-breaking. You would want to try   for the no-break version, though I don't think there's a wordy equivalent to using the hex code. (https://www.fileformat.info/info/unicode/char/202f/index.htm)

Michael Leddy said...

Ah, a narrow no-break space! I will have to try it when I’m at my Mac (and not on a phone). Many thanks, Richard.

Richard Abbott said...

Ha! Foiled first time by blogger being clever and converting the codes into their representations... let's ntry again
================
HTML &#8201, &thinsp, and indeed   are all the same. And they are all not no-breaking. You would want to try   for the no-break version
================
(Preview looks OK but we'll see...)

Michael Leddy said...

Yep — I got those codes in by going to one of those e-mail address encoders. If there’s an easier way, I’ve yet to find it.

Michael Leddy said...

I tried the narrow no-break, and it doesn’t break. But in Safari on my Mac the code makes no difference in appearance. These things must vary with operating systems and browsers. (Sigh.)