Quote:
Originally Posted by roger64
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
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:
And unicode spacing:
-
-  
- actual NARROW NO-BREAK SPACE character
And the HTML-based:
- <p>―<small> </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 : 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%;
}
(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> </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.