04-02-2020, 12:54 PM | #1 |
Connoisseur
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 ? |
04-02-2020, 01:49 PM | #2 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
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; } You can combat this in one of 2 ways:
|
|
Advert | |
|
04-02-2020, 04:01 PM | #3 |
Connoisseur
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. |
04-02-2020, 05:09 PM | #4 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
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. |
04-03-2020, 03:04 PM | #5 |
Resident Curmudgeon
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. |
Advert | |
|
04-04-2020, 06:52 AM | #6 | |
Connoisseur
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
|
Quote:
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. |
|
04-04-2020, 07:33 AM | #7 | |
Resident Curmudgeon
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:
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. |
|
04-04-2020, 10:54 AM | #8 |
Connoisseur
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
|
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. |
04-04-2020, 12:54 PM | #9 | |
Resident Curmudgeon
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:
|
|
04-05-2020, 07:38 AM | #10 | |
Connoisseur
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
|
Quote:
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. |
|
04-05-2020, 08:11 AM | #11 | |
Resident Curmudgeon
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:
|
|
04-05-2020, 08:45 AM | #12 |
Connoisseur
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 ! |
04-05-2020, 08:46 AM | #13 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Code:
-webkit-hyphenate-limit-after: 3; -webkit-hyphenate-limit-before: 3; How to apply it easily to all your kepubs will depend on how you're creating those kepubs. |
|
04-05-2020, 08:53 AM | #14 | |
Connoisseur
Posts: 58
Karma: 2112464
Join Date: Aug 2014
Device: Kobo Glo HD
|
Quote:
|
|
04-05-2020, 09:08 AM | #15 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
|
|
|
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 |