Mobileread
No break space and alignment
#1  roger64 11-13-2019, 01:18 AM
Hi

I use a lot of them as French punctuation rules recommend to use them. One of the use case is at the beginning of a paragraph, right after a "tiret de dialogue" (see screenshot). Adding a no-break space allow a nice vertical alignment of the first letters.

However, some may argue that the no-break space is justified, and as the space it represents can - slightly - vary, the alignment cannot be perfect.

I think, there are two ways to represent a no-break space
- if this character belongs to the embedded font, it can be represented by a fixed size space and the alignment is perfect.
- if this character is created by the reading software, it may be justified, and some glitches in the vertical alignment may appear.

If the above statement right?, what's the best way to obtain a perfect alignment?

image »
Reply 

#2  Tex2002ans 11-13-2019, 03:10 AM
Quote roger64
No-break space and alignment

I use a lot of them as French punctuation rules recommend to use them.
Did you accidentally post this in the wrong thread?

Quote roger64
One of the use case is at the beginning of a paragraph, right after a "tiret de dialogue" (see screenshot).
I don't read French, but from what I gather, you use the HORIZONTAL BAR (U+2015):



as a "quotation dash" instead of an EM DASH (U+2014) (how well the bar character is supported on actual devices... I'm not sure).

If there is supposed to be a space after, and the bar isn't flush against the text, your best bet might be the NO-BREAK SPACE (U+00A0) since it's the most well-supported.

(See issues with more "rare spaces" below.)

* * *

Hmmm... I'm not a French reader, so I don't know.

All I've ever read about is French spacing around your typical punctuation:

!?:;«»

In that case, the proper French spacing would use a THIN SPACE (U+2009) (or technically the NARROW NO-BREAK SPACE (U+202F)).

But to be the most compatible (and won't line-break between punctuation+text), just stick with the NO-BREAK SPACE (U+00A0).

It's been discussed thoroughly in these threads:

break/no-break and other spaces
Problem with inline image (Posts #26, #30 , #35, + especially my tests in #48)

Quote roger64
However, some may argue that the no-break space is justified, and as the space it represents can - slightly - vary, the alignment cannot be perfect.
A no-break space can be justified, it's not a fixed-width space.

The only difference from a normal space is it doesn't allow line-breaks.

Quote roger64
I think, there are two ways to represent a no-break space
- if this character belongs to the embedded font, it can be represented by a fixed size space and the alignment is perfect.
- if this character is created by the reading software, it may be justified, and some glitches in the vertical alignment may appear.

If the above statement right?, what's the best way to obtain a perfect alignment?
You won't be able to get that "perfect alignment" in ebooks.

The closest you could probably get is using a fixed-width space instead (like a THIN SPACE), but those are less well supported, and could lead to more egregious issues.

So I would still just say use a NO-BREAK SPACE:

Code
<p>―&nbsp;This is your sentence.</p>
and don't worry about the minute wiggling of first-character alignment.
Reply 

#3  roger64 11-13-2019, 03:52 AM
Sorry for posting in the wrong thread and thanks for your answer.

The narrow no-break space would be perfect if it was widely recognized. It's not.
The no-break space is the second best choice and is widely recognized. It's declared winner.
Reply 

#4  Hitch 11-13-2019, 09:36 AM
Quote roger64
Sorry for posting in the wrong thread and thanks for your answer.

The narrow no-break space would be perfect if it was widely recognized. It's not.
The no-break space is the second best choice and is widely recognized. It's declared winner.
Oh, hey, it's not like the forum police (mods) will come along and beat you for posting in the wrong place.

I did want to 2nd your comment about the thin-space. I really, really wish it would be widely recognized! There's a reason it exists and that's because, it's needed, dammit.

Hitch
Reply 

#5  Tex2002ans 11-13-2019, 02:08 PM
Quote roger64
The narrow no-break space would be perfect if it was widely recognized. It's not.
Thin space is the next most widely supported... but even that has inconsistent line-breaking applied across programs (noted in Post #45 referenced above).

(Now, the reason why you would ever want a thin space to actually line-break baffles me...)

Quote roger64
The no-break space is the second best choice and is widely recognized. It's declared winner.
Sadly, yes.

There's also all these ugly and hackish "solutions" floating around online, like trying to do:

Code
<p>―<small>&nbsp;</small>This is a sentence.</p>
but that would probably introduce even worse issues.

Quote Hitch
I did want to 2nd your comment about the thin-space. I really, really wish it would be widely recognized! There's a reason it exists and that's because, it's needed, dammit.
Indeed. Most common case in English is inner/outer quotes right next to each other:

“And then she said, ‘Are they supported yet?’ ”

but French... there just ain't no way around it!

Quote Hitch
Oh, hey, it's not like the forum police (mods) will come along and beat you for posting in the wrong place.
Maybe we could poke them and get these few posts split. It sure would make it easier to find if you didn't have search-engine-fu like me. :P
Reply 

#6  pdurrant 11-14-2019, 09:45 AM
Quote Hitch
Oh, hey, it's not like the forum police (mods) will come along and beat you for posting in the wrong place.
Quote Tex2002ans
Maybe we could poke them and get these few posts split. It sure would make it easier to find if you didn't have search-engine-fu like me. :P

Yes, when asked, they will come along and split posts into their own thread.
Reply 

#7  DNSB 11-15-2019, 02:07 AM
Quote pdurrant
Yes, when asked, they will come along and split posts into their own thread.
Thanks.
Reply 

#8  doubleshuffle 11-15-2019, 04:32 AM
Would using an empty span of a fixed width be a very bad and hackish solution?

Like this:

<span class="gap"></span>

span.gap {width: 10px} or {width: 0.5%} or whatever value you'd like...

You'd have a space that would be different on different screens, but it would be the same on one page.
Reply 

#9  pdurrant 11-15-2019, 04:38 AM
Can a span be set to be non-breaking?
Reply 

#10  doubleshuffle 11-15-2019, 04:42 AM
I don't think so. But that wouldn't matter in this use case: it's always right after an mdash at the beginning of a line, isn't it?
Reply 

  Next »  Last »  (1/5)
Today's Posts | Search this Thread | Login | Register