View Single Post
Old 11-16-2019, 05:39 PM   #14
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by roger64 View Post
This seems to work. I'll use it for my next book on MR.
... oh gods... don't do it.

Just because something could be done doesn't mean it should.

Quote:
Originally Posted by jhowell View Post
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.)
I took RbnJrg's example code and ran with it.

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;
}
Using these 3 CSS-based spacing:

Spoiler:
Code:
<p>―<span class="dialoguespace"> </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

[...]

<p>―<span class="dialoguespace">    </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

[...]

<p><span class="quotationspace">― </span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>


And unicode spacing:
  • &nbsp;
  • &thinsp;
  • actual NARROW NO-BREAK SPACE character

And the HTML-based:
  • <p>―<small>&nbsp;</small>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

Testing Notes

I tested using:
  • ADE 4.5 (Windows)
  • Sigil 0.9.14
  • Gitden Reader 4.5.3 (Android)
  • PocketBook 3.21.16694 (Android)
  • Kindle Previewer 3.34

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 &nbsp;: Depending on renderers, justification may change the size:
  • ADE 4.5 doesn't

All others do.

Kindle Note: The &nbsp; 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 &nbsp;.

Perhaps you could also add this to your CSS:

Code:
small {
	font-size: 50%;
}
(Or whatever size you want your hacked "thin space" to be.)

... 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>
ADE: These all broke across lines:
  • CSS-based
  • <small>&nbsp;</small>
  • Thin Space

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.
Attached Files
File Type: epub Dialogue.Spacing.Test.epub (2.5 KB, 348 views)
File Type: epub Dialogue.Spacing.Test[EmDash].epub (2.5 KB, 349 views)

Last edited by Tex2002ans; 11-16-2019 at 06:14 PM.
Tex2002ans is offline   Reply With Quote