11-13-2019, 12:18 AM | #1 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
No break space and alignment
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? Last edited by roger64; 11-13-2019 at 12:20 AM. |
11-13-2019, 02:10 AM | #2 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
― 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:
The only difference from a normal space is it doesn't allow line-breaks. Quote:
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>― This is your sentence.</p> Last edited by Tex2002ans; 11-13-2019 at 02:26 AM. |
||||
Advert | |
|
11-13-2019, 02:52 AM | #3 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
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. |
11-13-2019, 08:36 AM | #4 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
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 |
|
11-13-2019, 01:08 PM | #5 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
(Now, the reason why you would ever want a thin space to actually line-break baffles me...) Quote:
There's also all these ugly and hackish "solutions" floating around online, like trying to do: Code:
<p>―<small> </small>This is a sentence.</p> Quote:
“And then she said, ‘Are they supported yet?’ ” but French... there just ain't no way around it! 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 |
|||
Advert | |
|
11-14-2019, 08:45 AM | #6 | ||
The Grand Mouse 高貴的老鼠
Posts: 71,508
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
Quote:
Yes, when asked, they will come along and split posts into their own thread. Last edited by pdurrant; 11-14-2019 at 08:47 AM. |
||
11-15-2019, 01:07 AM | #7 |
Bibliophagist
Posts: 35,428
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
11-15-2019, 03:32 AM | #8 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
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. |
11-15-2019, 03:38 AM | #9 |
The Grand Mouse 高貴的老鼠
Posts: 71,508
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Can a span be set to be non-breaking?
|
11-15-2019, 03:42 AM | #10 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
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?
|
11-15-2019, 06:59 AM | #11 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Hi Roger:
Try this: Code:
<p>—<span class="ps"> </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p>—<span class="ps"> </span>Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus.</p> <p>—<span class="ps"> </span>Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.</p> Code:
p { text-align: justify; } .ps { white-space: pre; } Of course, you can set as your wish the amount of the spaces contained between the span tags (I used four, you can use whatever). VERY IMPORTANT: BEFORE AND AFTER the span block (<span class="ps"> </span>), there should be NO SPACE. |
11-15-2019, 10:49 AM | #12 | |
Grand Sorcerer
Posts: 6,497
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
Sizing in em would make the most sense because it would scale with the font size. I think that you would also need to use display:inline-block to allow the width to be effective. (I have not tested any of this.) |
|
11-16-2019, 01:26 PM | #13 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Hi Ruben This seems to work. I'll use it for my next book on MR. Thanks for your always creative ideas. |
|
11-16-2019, 05:39 PM | #14 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
... oh gods... don't do it.
Just because something could be done doesn't mean it should. Quote:
Attached is a sample EPUB using this CSS: Code:
p { text-align: justify; } .dialoguespace { display: inline-block; width: .25em; } .quotationspace { display: inline-block; width: 1.25em; } Spoiler:
And unicode spacing:
And the HTML-based:
Testing Notes I tested using:
Caution!!! I used the actual HORIZONTAL BAR character... it doesn't appear in ADE 4.5! So I would probably recommend using the EM DASH. Unicode-based Thin Space + Narrow No-Break Space don't change size in any. Note on Stretchiness of : Depending on renderers, justification may change the size:
All others do. Kindle Note: The after the HORIZONTAL BAR was very thin (looked to me like the size of an actual THIN SPACE). Perhaps a special kerning pair built-in. CSS-based EPUB-based readers looked to handle these okay, and the gap between didn't move. But Kindle Previewer 3 started to break when raising the font sizes. HTML <small> This hack didn't work... It might help in a handful of extremely rare cases where that tiny amount of ems might tell the algorithm not to stretch the . Perhaps you could also add this to your CSS: Code:
small { font-size: 50%; } ... but even then... shifting the window size around in Sigil still caused issues. Breaking Across Lines (I only tested this in Sigil/ADE by adding a nearly-full line of text before the bar + stretching the window to perfect size.) Sigil: All non-CSS solutions kept the bar+first-word across lines as they should. The CSS-based ones didn't work, except for: Code:
<p><span class="quotationspace">― </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
Final Thoughts ... so yeah, I really wish Thin Space + Narrow Non-Breaking Space were actually better well supported... that would be the best/proper solution. Last edited by Tex2002ans; 11-16-2019 at 06:14 PM. |
|
11-16-2019, 05:55 PM | #15 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
<p>—<span class="ps"> </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p>—<span class="ps"> </span>Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus.</p> <p>—<span class="ps"> </span>Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.</p> Code:
p { text-align: justify; } .ps { white-space: pre; } |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Display of narrow no-break space (Linux build) | roger64 | Sigil | 16 | 02-17-2018 10:35 AM |
Representing the no-break space | roger64 | Sigil | 11 | 08-09-2017 02:09 AM |
Narrow No-Break Space display | roger64 | Sigil | 6 | 12-20-2012 02:43 PM |
Narrow No-Break Space and commercial support. | roger64 | ePub | 8 | 09-04-2012 01:08 PM |
Is it possible to define rules for non break space? | habanr | Conversion | 4 | 02-22-2011 07:36 AM |