Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2020, 12:54 PM   #1
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Recenter images in kobo-justified mode

Hello,

I have the habit to convert all my epubs to kepubs, with a unified format.
One thing I noticed (and found mentioned elsewhere on the forum), it that when using the "justified" mode on the kobo, Centering information (mostly on images) are messed up.

I know that one solution is to enforce justified text when converting books in calibre then turn justify Off on the kobo. But for some reasons I'd like to find a way not to have to do that on some books. I'm ok with editing books and using a regex-find-and-replace, but I'm not very good at css. Is there some property that I could inject that would center images even in kobo-justifed mode ?
Simboubou is offline   Reply With Quote
Old 04-02-2020, 01:49 PM   #2
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
Quote:
Originally Posted by Simboubou View Post
Hello,

I have the habit to convert all my epubs to kepubs, with a unified format.
One thing I noticed (and found mentioned elsewhere on the forum), it that when using the "justified" mode on the kobo, Centering information (mostly on images) are messed up.

I know that one solution is to enforce justified text when converting books in calibre then turn justify Off on the kobo. But for some reasons I'd like to find a way not to have to do that on some books. I'm ok with editing books and using a regex-find-and-replace, but I'm not very good at css. Is there some property that I could inject that would center images even in kobo-justifed mode ?
First let me say that if you want to understand and control styling in your Kobo epubs/kepubs you really need to understand how HTML and CSS works. You don't need to be an expert but a basic understanding (and a willingness to learn more) is essential.

The problem you're running up against is the Kobo firmware's built-in CSS overrides used when you use the sliders and buttons in the [Aa] menu. Override CSS for kepub is more aggressive than the override CSS used for standard epub.

In the scenario you've raised the default override CSS for kepub text alignment is
Code:
div, p { text-align: %1 !important; }
so if you're wrapping your book's HTML <img> tags in a <div> or a <p> tag, then any text-align:center CSS styling is going to get overridden by whatever alignment button (left/justify) you've selected in the [Aa] menu.

You can combat this in one of 2 ways:
  1. If you're a user of the kobopatch system you can make the override CSS above less aggressive with a patch to the firmware. See patch Un-Force user text-align in div,p tags in KePubs
  2. If patching is not an acceptable option then you could try wrapping your book HTML <img> tags in any block HTML tag which is neither <div> nor <p>.
Personally I choose option 1. I have not tried option 2 (and it will probably make standards purists shudder ) but see no reason why it wouldn't work. Obviously you'd need to do it for every book.
jackie_w is offline   Reply With Quote
Advert
Old 04-02-2020, 04:01 PM   #3
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Thanks !

I do understand some basic html/css, but since I never write any, I have no idea which flags I could use for centering anything.

My firmware is patched, so solution 1 is possible. Wouldn't that also wreck text align tho ? I'll give it a try.
Simboubou is offline   Reply With Quote
Old 04-02-2020, 05:09 PM   #4
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
Quote:
Originally Posted by Simboubou View Post
Wouldn't that also wreck text align tho ? I'll give it a try.
Well, that depends on whatever other CSS text-align styles exist in your books.

The problem with override CSS and the !important property is ... it does exactly that. There's no "override CSS except when I don't want it to" crystal ball button

The problem with asking for CSS advice in these forums is that if 10 people reply you'll get 10 different answers. Impassioned arguments/ranting may ensue and at the end of it none of the 10 have changed their original opinion. In this respect it's much like forum discussions about copyright or piracy or the best way to create page numbers in ebooks.
jackie_w is offline   Reply With Quote
Old 04-03-2020, 03:04 PM   #5
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,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It's a bug in KePub. You cannot use either justification setting without screwing with centered text. The best thing is to put your preferred justification in the body class. It's what I do and I remove all left and full justification. That way, I can leave justification set to off.

Last edited by JSWolf; 04-03-2020 at 04:24 PM.
JSWolf is offline   Reply With Quote
Advert
Old 04-04-2020, 06:52 AM   #6
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Quote:
Originally Posted by JSWolf View Post
It's a bug in KePub. You cannot use either justification setting without screwing with centered text. The best thing is to put your preferred justification in the body class. It's what I do and I remove all left and full justification. That way, I can leave justification set to off.
I know, but then I lose the ability to turn hyphenation on or off on the kobo. I need to force-enable it when converting.

When I bought my first kobo, I struggled with hyphenations dictionaries, and ended up disabling it altogether.
But now, I've grown more aware of the weird spacing induced by the absence of hyphenation. So I wanted to try hyphenation again, with the ability to turn it off and on.

I re-tried the hyphen dicts you posted a while ago, and it works quite well for english, with hyphens being quite rare. I'm not sure french will work as well. We'll see.
Simboubou is offline   Reply With Quote
Old 04-04-2020, 07:33 AM   #7
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,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Simboubou View Post
I know, but then I lose the ability to turn hyphenation on or off on the kobo. I need to force-enable it when converting.

When I bought my first kobo, I struggled with hyphenations dictionaries, and ended up disabling it altogether.
But now, I've grown more aware of the weird spacing induced by the absence of hyphenation. So I wanted to try hyphenation again, with the ability to turn it off and on.

I re-tried the hyphen dicts you posted a while ago, and it works quite well for english, with hyphens being quite rare. I'm not sure french will work as well. We'll see.
Others have said that the French hyphenation dictionary I posted works well.

Set hyphenation on and edit the CSS for full justification. If you don't like it, you can go left justification by editing the CSS. and replacing the KePub in full with the KePub in left.
JSWolf is offline   Reply With Quote
Old 04-04-2020, 10:54 AM   #8
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Quote:
Originally Posted by JSWolf View Post
Others have said that the French hyphenation dictionary I posted works well.

Set hyphenation on and edit the CSS for full justification. If you don't like it, you can go left justification by editing the CSS. and replacing the KePub in full with the KePub in left.
I remember using a dict I found online (probably here?) for french Hyphens, but maybe it wasn't yours. It was long time ago. Anyway, I've read a few chapters with English hyphenation and it was good enough, so I guess I'll just convert setup my kepubs to force-hyphens for now on.

Last edited by Simboubou; 04-04-2020 at 10:56 AM.
Simboubou is offline   Reply With Quote
Old 04-04-2020, 12:54 PM   #9
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,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Simboubou View Post
I remember using a dict I found online (probably here?) for french Hyphens, but maybe it wasn't yours. It was long time ago. Anyway, I've read a few chapters with English hyphenation and it was good enough, so I guess I'll just convert setup my kepubs to force-hyphens for now on.
You could try the French hyphenation dictionary that I posted in the same thread as the English one.
JSWolf is offline   Reply With Quote
Old 04-05-2020, 07:38 AM   #10
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Quote:
Originally Posted by JSWolf View Post
You could try the French hyphenation dictionary that I posted in the same thread as the English one.
I installed new dicts, I do have poor hyphens with two letters on after the -.
I noticed that hyphenations was better on longer words, so I try to change the left and right hyphens length in the dic file. It does not seem to change kobo behaviour, unfortunately.
Simboubou is offline   Reply With Quote
Old 04-05-2020, 08:11 AM   #11
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,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Simboubou View Post
I installed new dicts, I do have poor hyphens with two letters on after the -.
I noticed that hyphenations was better on longer words, so I try to change the left and right hyphens length in the dic file. It does not seem to change kobo behaviour, unfortunately.
I suggest you read in ePub if the eBook does not have images (other then the cover and title page) and footnotes. Then you'll get better hyphenation.
JSWolf is offline   Reply With Quote
Old 04-05-2020, 08:45 AM   #12
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
I can try that, but epub reader is usually quite bad at filling pages (sometimes leaving the equivalent of 2 lines of blank space at the, while still having a 2-widow on the next page.

I guess I could try to mess around with orphans and widow settings as well. The thing is, the more I learn about typography, the more I see issues in the books I read

Well, I guess to reader is perfect, you have to accept whatever small issues you with the one you're using.

Still, I'll try to mess around with epubs settings and conversion for my next books. Thanks for your help !
Simboubou is offline   Reply With Quote
Old 04-05-2020, 08:46 AM   #13
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
Quote:
Originally Posted by Simboubou View Post
I installed new dicts, I do have poor hyphens with two letters on after the -.
I noticed that hyphenations was better on longer words, so I try to change the left and right hyphens length in the dic file. It does not seem to change kobo behaviour, unfortunately.
If you're talking about hyphenation in kepubs you can affect the right/left chars for hyphenation with CSS.
Code:
-webkit-hyphenate-limit-after: 3;
-webkit-hyphenate-limit-before: 3;
Adjust the values as required.

How to apply it easily to all your kepubs will depend on how you're creating those kepubs.
jackie_w is offline   Reply With Quote
Old 04-05-2020, 08:53 AM   #14
Simboubou
Connoisseur
Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.Simboubou ought to be getting tired of karma fortunes by now.
 
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
Quote:
Originally Posted by jackie_w View Post
If you're talking about hyphenation in kepubs you can affect the right/left chars for hyphenation with CSS.
Code:
-webkit-hyphenate-limit-after: 3;
-webkit-hyphenate-limit-before: 3;
Adjust the values as required.

How to apply it easily to all your kepubs will depend on how you're creating those kepubs.
I use calibre to create convert epubs to kepubs. I checked : the books do contain the above lines. So I don't know.
Simboubou is offline   Reply With Quote
Old 04-05-2020, 09:08 AM   #15
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
Quote:
Originally Posted by Simboubou View Post
I use calibre to create convert epubs to kepubs. I checked : the books do contain the above lines. So I don't know.
If you're using the KoboTouchExtended plugin to create your kepubs look closely at the contents of the css/hyphenation.css file. You may need to manually correct it. See my latest post in the plugin thread.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch mode to compress images pmichelazzo Editor 2 06-17-2018 04:33 AM
Images are left justified after conversion - what am I doing wrong? Shazzyloulou Conversion 2 09-24-2015 05:25 PM
Matano and images in Night Mode Thomas_AR Android Devices 6 05-14-2015 09:35 PM
Full Justified or Left Justified? JSWolf General Discussions 96 02-04-2013 06:57 PM
Left-justified text in a right-justified box Skeezix Conversion 4 11-15-2011 08:44 PM


All times are GMT -4. The time now is 12:31 PM.


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