View Single Post
Old 11-17-2019, 11:06 AM   #18
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,849
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
Just tested that specific code too...

The spacing looks okay in Sigil, but in ADE the gap still stretches when I make the window bigger/smaller.
The spacing will look ok in all render engine based on Webkit. So, in Sigil, Calibre, Kobo, etc., the aproximation will work perfectly.

Quote:
And it still line-breaks (Sigil/ADE/PocketBook).
The solution is not intended to be applied in a middle of a sentence, just at the beggining.

Quote:
In ADE/PocketBook, the white-space: pre; also causes this:

Code:
This is an example of text —  <--- 2 spaces to right-edge
  Lorem ipsum [...] <--- 2 spaces along left-edge too, so line looks "indented"
... so I'm assuming other font-/screen-sizes... things are also going to explode.
First at all, PocketBook employs two render engines: RMSDK and WebKit. So, if you use WebKit, no problem should be in PocketBook. Besides, this is not a replace for a bullet in an unordered list; just is to denote a dialog.

Finally, THE SOLUTION FOR RMSDK is the following:

Code:
<p>—<span class="ps">&nbsp;</span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>—<span class="ps">&nbsp;</span>Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus.</p>
<p>—<span class="ps">&nbsp;</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>
with

Code:
p {
  text-align: justify;
}

.ps {
  white-space: pre;
}
That code works in my testing under ADE, Sigil, Calibre, Azardi and Kindle Previewer 2.92. So, with RMSDK and WebKit works! The issue seems to be with Kindle Previewer 3.35; with some fonts the alignment is not produced. Amazon must be using a different render engine with .KFX (because with .kf8 all is ok). Under .KFX, when Amazon is justifying the text, in some way is adding a space between "—" and "<span class="ps">&nbsp;</span>". And still I couldn't find a fix for that case. Also your aproximation has issues with Kindle Previewer 3.35.

Last edited by pdurrant; 11-17-2019 at 11:48 AM. Reason: fixed quote tag
RbnJrg is offline   Reply With Quote