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-16-2018, 06:27 AM   #1
Vetchy
Connoisseur
Vetchy began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Dec 2017
Device: Kobo Aura One
KEPUB and non-breaking space

Dear community members.
Does any way to connect with Kobo and request to support non-breaking space for KEPUB?

In Russian language (maybe in other too). Direct speach has a
Now, when exist dialog in book, that looks like this:
Quote:
—I will not accept it!
—Can I speak to the doctor?
But between dash and letter exist non-breaking space. And dialog must looking as:
Quote:
— I will not accept it!
— Can I speak to the doctor?
That problem not important, when books creat perfectly. But often, I look case, when one dialog looks below:
Quote:
—I will not accept it!
— Can I speak to the doctor?
— NO!
—Why?
This jumps break my eyes.

Last edited by Vetchy; 01-16-2018 at 06:30 AM.
Vetchy is offline   Reply With Quote
Old 01-16-2018, 07:31 AM   #2
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
Sorry, from your examples, I can't tell anything. As far as I can see, some have spaces between the dash and first letter, and some don't. If the renderer added spaces where the book creator didn't, that would be a bug. Can you create a small kepub that demonstrates what you mean? A screenshot would also help show what you mean.

As you mention, as far as I've been able to see, the kepub renderer does support non-breaking space. I have attached a test kepub that demonstrates this. This has a lot of different things in it, but at the end of the chapter titled "Various test items", I have put all the types of spaces that I could think of. Each space is named and then put between quotes to show where it is. I have used both the unicode and HTML entity. The non-breaking space is there in both cases.

I've also attached a screenshot of this taken on my Aura H2O using firmware 4.7.10413.

As to contacting Kobo, there are help link includes a way to report problems.
Attached Thumbnails
Click image for larger version

Name:	KepubSpaces.png
Views:	411
Size:	86.5 KB
ID:	161593  
Attached Files
File Type: epub Font Tester V3 - kepub - Ann Onymous.kepub.epub (1.49 MB, 228 views)
davidfor is offline   Reply With Quote
Advert
Old 01-16-2018, 07:45 AM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@davidfor,

I think Vetchy may be asking the same question Semwize did in this post.

All Semwize's paragraphs were coded something like the following (without spaces):
<p ...>mdash nbsp some text</p>
but because the paragraphs were full-justified the nbsp was not a consistent width.
jackie_w is offline   Reply With Quote
Old 01-16-2018, 09:35 AM   #4
Vetchy
Connoisseur
Vetchy began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Dec 2017
Device: Kobo Aura One
Quote:
Originally Posted by jackie_w View Post
@davidfor,

I think Vetchy may be asking the same question Semwize did in this post.

All Semwize's paragraphs were coded something like the following (without spaces):
<p ...>mdash nbsp some text</p>
but because the paragraphs were full-justified the nbsp was not a consistent width.
You right. A have this bug.
Vetchy is offline   Reply With Quote
Old 01-16-2018, 11:06 AM   #5
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
From what I've seen when using the KePub reader, there are three different issues that affect this:

1. As noted above, the KePub reader treats no-break spaces as stretchable (the ePub reader doesn't).

2. Even without a no-break space after the dash, the KePub reader adds a zero-width stretchable space around certain characters, including em-dash and ellipsis(*). This wouldn't be a problem, except that ... (Edit: It is still a problem, it seems the KePub reader now adds this space around quotation-dash too.)

3. ... The correct dash character to use for quoting text is the quotation-dash (U+2015), but most publishers use the em-dash (U+2014) instead.


(*) There is another KePub bug: the space is only added to the right of the characters, instead of both sides, and this in turn can cause the whole line to be incorrectly justified if it contains one of there characters. But this bug doesn't really affect the OP's problem. This bug can be avoided by enabling the text-rendering:optimizeSpeed; or text-rendering:optimizeLegibility CSS options, but doing so has other side-effects.

(It's the accumulation of all these little typographical bugs in the KePub reader that leads me to prefer ePub over KePub.)

Last edited by GeoffR; 01-16-2018 at 12:15 PM. Reason: Quotation-dash doesn't solve issue 2. in KePub
GeoffR is offline   Reply With Quote
Advert
Old 01-16-2018, 11:35 AM   #6
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 GeoffR View Post
3. ... The correct dash character to use for quoting text is the quotation-dash (U+2015)
horbar; (U+2015)
Same thing, it's not working right.

Last edited by Semwize; 01-13-2019 at 03:00 AM.
Semwize is offline   Reply With Quote
Old 01-16-2018, 11:44 AM   #7
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by Semwize View Post
horbar; (U+2015)
Same thing, it's not working right.
I think that is because you have a space between the dash and the quoted text, which is issue 1.

If you remove the space, then em-dash suffers issue 2. while quotation-dash works correctly.

(You'd suffer the same issues if you has a space between the quote and the quoted text with other quotation styles. "", '', etc.)

Last edited by GeoffR; 01-16-2018 at 11:48 AM.
GeoffR is offline   Reply With Quote
Old 01-16-2018, 12:00 PM   #8
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
GeoffR,
removed space between the horbar (U+2015) and the quoted text. It got worse. Space between adds, but also stretches
Semwize is offline   Reply With Quote
Old 01-16-2018, 12:12 PM   #9
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by Semwize View Post
GeoffR,
removed space between the horbar (U+2015) and the quoted text. It got worse. Space between adds, but also stretches
Okay sorry, I didn't test it recently, I guess that is another bug to add to the KePub bug list then. (i'll edit my original post to note this.)

The ePub reader recognises the difference between the quotation-dash and em-dash, and although the ePub reader doesn't suffer the stretchy space problems, using the quotation-dash prevents a line break after the em-dash.
GeoffR is offline   Reply With Quote
Old 01-16-2018, 12:17 PM   #10
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
I myself was wondering how to fix it, you said that I haven't tried)

epub yes, everything works perfectly.
Semwize is offline   Reply With Quote
Old 01-16-2018, 07:18 PM   #11
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
OK, I had a suspicion that Vetchy was referring to this problem, but I couldn't quickly find the other posts.

And the problem isn't that the kepub renderer doesn't support non-breaking spaces, but that it doesn't handle them in the same way as other renderers.

Quote:
Originally Posted by GeoffR View Post
1. As noted above, the KePub reader treats no-break spaces as stretchable (the ePub reader doesn't).
From my minimal typographical knowledge, I would have said that the way the kepub renderer was treating a non-breaking space was the correct way. To me, the difference between it and a normal space should just be that it prevents a line-break happening at that point. Otherwise, I would have expected it to be stretched in the same way as the normal space when justifying the text. And a quick search doesn't find anything that suggests the non-breaking space should be treated as anything other than a normal space except with respect to line-breaks and whether HTML renders will merge them when there are multiples.

Or is the problem here not how the non-breaking space is working, but how the other characters are? The kepub renderer is putting spacing between the emdash and words when justifying the line. That is apparently wrong. In the screenshot from Semwize, can anyone tell if this is because of the non-breaking space or because of the bad handling of the emdash?
davidfor is offline   Reply With Quote
Old 01-17-2018, 01:27 AM   #12
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
And a quick search doesn't find anything that suggests the non-breaking space should be treated as anything other than a normal space except with respect to line-breaks and whether HTML renders will merge them when there are multiples.
NARROW NO-BREAK SPACE (U+202F) for example

in kepub also stretches, it's wrong

Last edited by Semwize; 01-17-2018 at 01:45 AM.
Semwize is offline   Reply With Quote
Old 01-17-2018, 03:59 AM   #13
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 : on the principle, you're probably right but i've yet to see an example in a paperbook (and i'm working as a librarian) : in french, it would ruin all the layout when justification and dialog are involved. The narrow non-breaking space should be use (but it's never used) and as @Semwize said, nnbsp are also streched in kepub...


https://bugs.documentfoundation.org/...g.cgi?id=41652
https://bz.apache.org/ooo/show_bug.cgi?id=23333

Last edited by cramoisi; 01-17-2018 at 04:04 AM.
cramoisi is offline   Reply With Quote
Old 01-17-2018, 06:06 AM   #14
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
NARROW NO-BREAK SPACE (U+202F) for example

in kepub also stretches, it's wrong
I'll repeat what I said about non-breaking space, where does it state that NARROW NO-BREAK SPACE should not be stretched? Again, my search doesn't find anything that makes a statement either way.

And, again, are your sure it isn't what is happening around the character? These seem to be used next to punctuation such as emdashes. The kepub render is putting spacing around these, so that might be where the extra spacing is coming from.
davidfor is offline   Reply With Quote
Old 01-17-2018, 06:19 AM   #15
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 : on the principle, you're probably right but i've yet to see an example in a paperbook
You mean in a book that didn't rely on on-the-fly rendering to do this? And very likely had someone check things before it went to the printer?
Quote:
(and i'm working as a librarian) : in french, it would ruin all the layout when justification and dialog are involved. The narrow non-breaking space should be use (but it's never used) and as @Semwize said, nnbsp are also streched in kepub...


https://bugs.documentfoundation.org/...g.cgi?id=41652
https://bz.apache.org/ooo/show_bug.cgi?id=23333
Are you sure you meant to point to those? The report in the first one starts with:

Quote:
The character “NO-BREAK SPACE” (U+00A0) is incorrectly interpretated like
“fixed width no-break space”.
And most of the rest agrees.

And right down the bottom of this is a link to Unicode Line Breaking Algorithm. And that has the following:

Quote:
When compression or expansion is allowed, a locally optimal line break seeks to balance the relative merits of the resulting amounts of compression and expansion for different line break candidates. When expanding or compressing interword space according to common typographical practice, only the spaces marked by U+0020 SPACE and U+00A0 NO-BREAK SPACE are subject to compression, and only spaces marked by U+0020 SPACE, U+00A0 NO-BREAK SPACE, and occasionally spaces marked by U+2009 THIN SPACE are subject to expansion. All other space characters normally have fixed width. When expanding or compressing intercharacter space, the presence of U+200B ZERO WIDTH SPACE or U+2060 WORD JOINER is always ignored.
That says NO-BREAK SPACE should be treated the same as a normal space with respect to its width.
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 06:07 PM.


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