Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-16-2019, 06:29 PM   #16
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by RbnJrg View Post
I don't understand you. Why do you say that

[...]

doesn't work?
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.

And it still line-breaks (Sigil/ADE/PocketBook).

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.

Last edited by Tex2002ans; 11-16-2019 at 06:32 PM.
Tex2002ans is offline   Reply With Quote
Old 11-16-2019, 09:30 PM   #17
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

For my first test with Calibre, I only need one space ("pre") instead of four and the vertical alignment seems OK. If I only use it for dialogues, I do not worrry about line-breaks.


it seems to work OK with Sigil, the Calibre viewer and Prince PDF.

It works also nicely with Koreader ePub (Cool Reader engine)

Next book; I'll try another solution from Tex

Last edited by roger64; 11-17-2019 at 04:59 AM.
roger64 is offline   Reply With Quote
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,539
Karma: 6613969
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
Old 11-17-2019, 07:00 PM   #19
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thank you both for your extensive trials.

I'll use this latest Ruben proposal for my next book. It adds to the no-break quality of the "nbsp" the fixed space of the "pre" css command.

Could it be the best of two worlds?
roger64 is offline   Reply With Quote
Old 11-17-2019, 09:06 PM   #20
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
roger, why do you want to use such poor code? Just use a left margin with a negative indent and be done with it. That's what works.
JSWolf is offline   Reply With Quote
Old 11-18-2019, 02:30 AM   #21
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thanks for your advice.

Ruben's code deserves at least one try. Here it is.
roger64 is offline   Reply With Quote
Old 11-18-2019, 06:42 AM   #22
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,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by JSWolf View Post
roger, why do you want to use such poor code? Just use a left margin with a negative indent and be done with it. That's what works.
¿Poor code? I see you didn't understand of the nature of the Roger's issue. He is not seeking a replace for a bullet in an unordered list. By the way, I also see that you didn't bother to test your "rich code" either. If you had done it, you would have seen that the alignment varies with different font sizes, and different font names. You can not set an unique margin and one unique text-indent that work with all font sizes and all font family. So that, it is your solution that is really poor (no offense).
RbnJrg is offline   Reply With Quote
Old 11-18-2019, 06:46 AM   #23
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,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by roger64 View Post
Thanks for your advice.

Ruben's code deserves at least one try. Here it is.
I saw it, and to me, it looks perfect! (even with the EPUBReader plugin for Chrome).
RbnJrg is offline   Reply With Quote
Old 11-18-2019, 06:44 PM   #24
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
I did not test it thoroughly but I'll keep it unless proven wrong by some tester.

Again, thanks for your help.
roger64 is offline   Reply With Quote
Old 11-19-2019, 05:44 PM   #25
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by RbnJrg View Post
I saw it, and to me, it looks perfect! (even with the EPUBReader plugin for Chrome).
You're not getting stretchiness on ADE when changing the window size?
Tex2002ans is offline   Reply With Quote
Old 11-20-2019, 06:24 AM   #26
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,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
You're not getting stretchiness on ADE when changing the window size?
In my test with ADE 4.5 I didn't notice anything with

Code:
<p>—<span class="ps">&nbsp;</span>Lorem ipsum dolor sit amet, consectet...</p>

------------

p {
  text-align: justify;
}

.ps {
  white-space: pre;
}
The only issue is with Kindle Previewer 3.35 (with Kindle Previewer 2.92 all is fine). Of course, Roger asked for a solution for .epub, and for .epub, the code above works fine everywhere. But there is problems with .KFX (with .kf8 all is ok). Amazon must be using a different render engine with .KFX, because with WebKit my aproximation works; I tested it with Sigil, Calibre, Azardi, KP 2.92, EPUBReader plugin for Chrome and Roger said that also works with Kobo.
RbnJrg is offline   Reply With Quote
Old 11-20-2019, 08:44 AM   #27
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,494
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by RbnJrg View Post
The only issue is with Kindle Previewer 3.35 (with Kindle Previewer 2.92 all is fine). ... But there is problems with .KFX (with .kf8 all is ok). Amazon must be using a different render engine with .KFX, because with WebKit my aproximation works; ...
The KF8 renderer used in KPR 2.92 is based on Webkit so it is not surprising that it works as you expect.

The KFX renderer is Amazon's own creation and according to the Amazon Kindle Publishing Guidelines, Appendix B: Attributes and Tags Supported by Enhanced Typesetting, the only values it supports for the "white-space" property are "nowrap" and "normal".
jhowell is offline   Reply With Quote
Old 11-20-2019, 02:44 PM   #28
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by RbnJrg View Post
In my test with ADE 4.5 I didn't notice anything with

Code:
<p>—<span class="ps">&nbsp;</span>Lorem ipsum dolor sit amet, consectet...</p>

------------

p {
  text-align: justify;
}

.ps {
  white-space: pre;
}
Just confirmed.

In ADE:

Using &nbsp; didn't stretch.

Using 1 or more normal space (as the previous examples), you get the stretchiness.

I attached an EPUB using your code + various amounts of normal spaces.

Quote:
Originally Posted by RbnJrg View Post
The solution is not intended to be applied in a middle of a sentence, just at the beginning.
Hmmm, I'm not familiar enough with languages that use this "quotation dash" convention.

Is it guaranteed they always begin the line? These types of dashes can't occur in the middle of paragraphs?

Because wrapping the &nbsp; in a <span> line-breaks in ADE... which defeats half of the actual functionality!
Attached Files
File Type: epub RbnJrg.Quotation.Dash.Spacing.Test.epub (2.1 KB, 200 views)
Tex2002ans is offline   Reply With Quote
Old 11-20-2019, 03:37 PM   #29
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,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
Just confirmed.

In ADE:

Using &nbsp; didn't stretch.
"O thou, man of little faith"

Quote:
Hmmm, I'm not familiar enough with languages that use this "quotation dash" convention.

Is it guaranteed they always begin the line?
Not always (but generally, they do). Sometimes dialogs that use quotation dash start in a middle of a sentence. But in a middle of a sentence, is not important the aligment because the answer won't start at the same place of the question, one line below. The issue is important in cases where the dialogs start at the beggining of a line.

Quote:
These types of dashes can't occur in the middle of paragraphs?
Yes

Quote:
Because wrapping the &nbsp; in a <span> line-breaks in ADE... which defeats half of the actual functionality!
The solution based on

Code:
—<span class="ps">&nbsp;</span>Some text here
works perfectly in ADE even in the middle of a sentence. I repeat you, the only issue is with .KFX (with .kf8 all is ok); I still couldn't find a fix for that format.

By the way, if you in the class "ps" use the following properties:

Code:
.ps {
  white-space: pre;
  background: red;
}
you'll see how the space is treated in any render engine. It's very interesting what Kindle Previewer 3.35 does with different size of fonts and different fonts. The property "white-space: pre" is not being supported. As I said before, Amazon seems not to be using WebKit with .KFX. Maybe in future releases of KP that drawback is removed.
RbnJrg is offline   Reply With Quote
Old 11-20-2019, 06:47 PM   #30
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,494
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by RbnJrg View Post
you'll see how the space is treated in any render engine. It's very interesting what Kindle Previewer 3.35 does with different size of fonts and different fonts. The property "white-space: pre" is not being supported. As I said before, Amazon seems not to be using WebKit with .KFX. Maybe in future releases of KP that drawback is removed.
I did some testing with the Kindle Previewer and had good results there by replacing the non-breaking space with a figure space ( &#x2007; ). KFX treats that as having a fixed width.
jhowell is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 01:09 AM.


MobileRead.com is a privately owned, operated and funded community.