Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2018, 06:31 AM   #16
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
While writing the above posts I've been thinking about how to prove if the kepub renderer is changing the width of the NO-BREAK SPACE. And I realised the test book I posted can do it.

Open it to the page with the spaces. Choose a font and size. It will be easier with a larger font as the line needs to go over to the next line. Set it to justify and then step through the margin lengths. Does the distance between the two quotes for the NO-BREAK SPACE? My eyes say it doesn't change, but the space just before it does. But, it might be a better test if there were letters either side instead of the quote. Using punctuation characters might affect the behaviour.
davidfor is offline   Reply With Quote
Old 01-17-2018, 06:32 AM   #17
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
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 it work to use an empty span with a fixed width?


html
Code:
—<span class="dialogue"></span>Yadda...
css
Code:
span.dialogue {width:5px}

or

span.dialogue {width:1mm}
doubleshuffle is offline   Reply With Quote
Old 01-17-2018, 07:46 AM   #18
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by davidfor View Post
NO-BREAK SPACE should be treated the same as a normal space with respect to its width.
Why does ePub and Word not stretched non-breaking space?
Semwize is offline   Reply With Quote
Old 01-17-2018, 02:51 PM   #19
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
@davidfor : yes , i was agreeing with you (and was too tired to be clear haha) ; in french the correct use for a fixed width would be the narrow non breaking space but whatever. (there is a distinction in french between a non breaking space with fixed width and a "variable width" non breaking space). this distinction is irrelevant in english because there is no need of a space before punctuation.

@Semwize : as i linked above: because of a bug so old it became a fact

(but I'm still saying in case of dialogues, the stretching is ulgy and problematic for the reading so I use epubs (it's the only case where it's a real problem, in fact) In french dialogues must be aligned (each first word after each dash have to be aligned, as a rule)

Last edited by cramoisi; 01-17-2018 at 03:34 PM.
cramoisi is offline   Reply With Quote
Old 01-17-2018, 03:05 PM   #20
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by cramoisi View Post
but I'm still saying in case of dialogues, the stretching is ulgy and problematic for the reading so I use epubs
Yes, I agree with you and also use epub. Kepub very ugly dialogues.
Semwize is offline   Reply With Quote
Old 01-17-2018, 06:06 PM   #21
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Semwize View Post
Yes, I agree with you and also use epub. Kepub very ugly dialogues.
And as I keep saying, please prove that the kepub renderer is stretching the spaces. I posted a crude test for how to do it, and my comment that it doesn't seem to happen. I've also posted why I think you are seeing the extra spaces - the treatment of the other punctuation characters such as the em dash and en dash. The kepub renderer adds spacing around these when justifying the text.

Here's another test for this:

Take you text that use em dashes to indicate dialog. Replace the em dashes with some other punctuation. I'm not sure what would be best, but my first thought is a quote character, maybe just the straight quote mark. The idea is to choose a character that is treated as you correctly. So, maybe a letter will work. Then what happens when you look at that page using the kepub renderer? Do the lines that need to be justified behave differently at the start to the lines that don't? Assuming each line had started with an em dash and a no-break space as the OP stated, and now starts with some other character followed by the no-break space, this should give a better idea whether the no-break space is stretched or not.
davidfor is offline   Reply With Quote
Old 01-18-2018, 12:58 AM   #22
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by davidfor View Post
em dash and en dash. The kepub renderer adds spacing around these when justifying the text.
Yes, I checked. Adds and stretches.

Because of this, the dialogues in Russian, French, etc languages become disgusting for reading.
Semwize is offline   Reply With Quote
Old 01-18-2018, 01:43 AM   #23
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Semwize View Post
Yes, I checked. Adds and stretches.
Can you tell me how you checked that it stretches the no-breaking space? My quick and dirty test seemed to show how it didn't. And I haven't had a chance to try my other test.
davidfor is offline   Reply With Quote
Old 01-18-2018, 01:46 AM   #24
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
@davidfor : ok, i checked the first book i bought from the kobo store

https://www.dropbox.com/s/2t5orhocyr...38.59.png?dl=0

https://www.dropbox.com/s/2vslmvwpk5...43.59.png?dl=0

Then, i remove the drm and check inside it : there's only a "justified space" (aka : a common space) after each dash. So I put fine space, and recheck : there is a difference but very slight at this police size :

https://www.dropbox.com/s/1st8pqdj05...04.54.png?dl=0

But when i change the margin and the size you can see it clearly :

https://www.dropbox.com/s/jdi8semo31...12.37.png?dl=0

The problem is that kobo doesn't use a fixed width space where it should be in french even if they conserve the correct width in the kobo application desktop.

Last edited by cramoisi; 01-18-2018 at 02:15 AM.
cramoisi is offline   Reply With Quote
Old 01-18-2018, 01:53 AM   #25
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
Quote:
Originally Posted by davidfor View Post
Can you tell me how you checked that it stretches the no-breaking space? My quick and dirty test seemed to show how it didn't. And I haven't had a chance to try my other test.
I generally removed the nonbreaking spaces (<p>m-dashtext), space stretches. That's what I meant.

Screenshot above.

This is not good, the dialogues are really all crooked.

Last edited by Semwize; 01-18-2018 at 02:04 AM.
Semwize is offline   Reply With Quote
Old 01-18-2018, 02:03 AM   #26
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by cramoisi View Post
@davidfor : it does for the one kepub i bought on the store. The result is explicit.
First link : the kobo epub displayed from the kobo desktop :

https://www.dropbox.com/s/2t5orhocyr...38.59.png?dl=0

Second link : the same official kepub displayed in nickel :

https://www.dropbox.com/s/2vslmvwpk5...43.59.png?dl=0
Sorry, I have at no point made any claim that the kepub renderer is not doing something wrong. It is clear from several screen shots that have been displayed of the effect. What I am questioning is what is happening under the covers.

The OP stated that no-breaking spaces were not supported. That is wrong. They are supported and do at least two of the expect functions (act as a space, prevent line breaks).

Semwize is stating that no-breaking spaces are treated the same as a normal space and will be expanded or compressed as needed to justify the text. From the evidence I see, that is not the case. As I have stated several times, I suspect it is the handling of the other characters near the no-breaking space that is contributing the extra spacing and making it look like the no-breaking space is actually the culprit.

If someone wants another way to test this, then create an epub with the following in it:

Code:
<p>m&nbsp;m m&nbsp;m m&nbsp;m m&nbsp;m m&nbsp;m m&nbsp;m m&nbsp;m</p>
But, repeat that enough to flow over more than one line. The change the margins on the device and see what happens to the spacing. If all are always equal, then the no-breaking space is being stretched like the normal space. If there are differences, then they are not being stretched.

But, I'll also state that based on my research, stretching the non-breaking space is the correct behaviour. The fact that no renderer has gotten this correct doesn't keep it form being correct. That means that for languages like those under discussion, it should be done by some other method. Possible a narrow-non-breaking space. Or two. From the discussion a while ago about French, I thought that was the character that should be used.
davidfor is offline   Reply With Quote
Old 01-18-2018, 02:08 AM   #27
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Semwize View Post
I generally removed the nonbreaking spaces (<p>m-dashtext), space stretches. That's what I meant.

Screenshot above.
Sorry, I don't understand what you are saying you do. And the only screenshot I can see of yours is one I thought you said demonstrated this issue with an em dash and a non-breaking space. But looking at it, you seem to say you tried GeoffR's suggestion of using a quotation-dash (U+2015).

Which is it?

Maybe the best solution is to post a sample book to look at.
davidfor is offline   Reply With Quote
Old 01-18-2018, 02:18 AM   #28
Semwize
Guru
Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.Semwize ought to be getting tired of karma fortunes by now.
 
Posts: 873
Karma: 252902
Join Date: Jun 2016
Device: Kobo
As GeoffR advised, I removed the spaces after m-dash (n-dash, quotation-dash - I checked all these symbols). The space after m-dash (n-dash, quotation-dash) is stretched.

Last edited by Semwize; 01-18-2018 at 02:23 AM.
Semwize is offline   Reply With Quote
Old 01-18-2018, 02:22 AM   #29
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
Quote:
Originally Posted by davidfor View Post
But, I'll also state that based on my research, stretching the non-breaking space is the correct behaviour. The fact that no renderer has gotten this correct doesn't keep it form being correct. That means that for languages like those under discussion, it should be done by some other method. Possible a narrow-non-breaking space. Or two. From the discussion a while ago about French, I thought that was the character that should be used.
I agreed with that (the streching of the nbsp, i even post 2 links stating this).

My second screenshot only shows that where one's could think the space wrongly stretch in kepub, it's normal since they are normal spaces where it's should not.

And in the screenshot above (the third and fourth) I use a narrow-non-breaking-space and it stretches too. So there is no solution for that regarding kepub.

(I edit my post when you were writing your answer, could you recheck ?)

Last edited by cramoisi; 01-18-2018 at 02:26 AM.
cramoisi is offline   Reply With Quote
Old 01-18-2018, 05:45 AM   #30
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Semwize View Post
As GeoffR advised, I removed the spaces after m-dash (n-dash, quotation-dash - I checked all these symbols). The space after m-dash (n-dash, quotation-dash) is stretched.
Have I gotten this completely wrong? You are not discussing if the non-breaking space is stretched, simply that an em dash and space at the start of the dialog doesn't do what you want. OK then, apparently, I've been barking up the wrong tree.

But, I'm still curious about whether the non-breaking space is stretching or not.

And for another part of my curiosity, what did Kobo say when you reported the problem?
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-breaking space JSWolf ePub 38 06-09-2020 09:00 PM
non-breaking space cramoisi KOReader 22 04-25-2017 03:47 AM
Non breaking space (possible) bug rferran Sigil 3 12-02-2016 12:33 PM
Non-Breaking space drago87 Conversion 0 01-20-2016 05:52 AM
Why the non-breaking space? Notjohn Sigil 2 06-08-2015 05:24 AM


All times are GMT -4. The time now is 01:26 PM.


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