|
|
#16 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 605
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
|
Anwer by Deepseek:
Rule 1 — Turn hyphenation ON everywhere
Rule 2 — Turn hyphenation OFF for headings and table cells This overrides the universal rule for a specific set of elements:
Why this pattern is common in EPUBs EPUB renderers are essentially mini web browsers, so standard CSS applies. Hyphenation is one of the few typographic features that meaningfully improves readability on the small screens typical of e-readers and phones — but only for body prose. Applying it globally and then explicitly excluding headings and tables is a compact, robust way to get the best of both worlds: Element Hyphenation Reason Body text ✅ on Reduces ragged edges / word gaps in justified text Headings ❌ off Short text, visual clarity Table cells ❌ off Preserves column alignment and readability Minor style notes type="text/css" is deprecated in HTML5 and unnecessary in modern XHTML, but it's still widely used in EPUB 2 files for compatibility with older reading systems. EPUB 3 files can drop it. Splitting the CSS across two <style> blocks is unnecessary — it could be a single block — but it's harmless and often results from how a tool generated the file. |
|
|
|
|
|
#17 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,421
Karma: 154365103
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Since my Kobo is not the best to test this due to config settings and patches, would hyphenation work in KePub if the code to turn it on was put in the CSS once instead of in each of the HTML files? If the answer is yes, I would prefer the code in CSS not in HTML.
|
|
|
|
| Advert | |
|
|
|
|
#18 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 55,353
Karma: 182532776
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
You can add this into a CSS file instead of a style block in a XHTML files but check the positioning. Cascading style sheets are position sensitive hence the !importants. Last edited by DNSB; 10-22-2026 at 05:09 PM. |
|
|
|
|
|
|
#19 | ||
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 254
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
Quote:
So the Kobo reads the rule from a CSS file just as it does from a style element. Why kepubverto still writes it into each chapter: a separate file means adding a file to the book, listing it in the OPF and linking it from every chapter. kepubverto does not touch the OPF, and the style element at the end of the head is always the last rule in the cascade, so the result does not depend on where the book's own stylesheets are linked. On the device the two give the same result. If you prefer the rule in the book's CSS, you can add it there yourself before converting and leave --hyphens off; kepubverto keeps your CSS as it is. Quote:
One correction to the explanation in #16: hyphenation on the Kobo does not need lang on the html element. On my Kobo, a Turkish book whose language was declared only in the OPF was hyphenated by Turkish rules. Since my last post, kepubverto 0.3.0 is out. It adds --css, which puts your own CSS into every converted chapter, after kepubverto's rules. It refuses CSS that refers to a file, has @font-face, or would make epubveri report a problem in the book, and says why. The web page has the same option as an Extra CSS box: https://veripublica.github.io/kepubverto/ https://github.com/veripublica/kepub...ses/tag/v0.3.0 https://crates.io/crates/kepubverto https://www.npmjs.com/package/@verip...epubverto-wasm |
||
|
|
|
|
|
#20 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,421
Karma: 154365103
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Can you make it an option to have the hyphenation code in the CSS or the HTML? I really dislike every HTML getting the same code when it can be done once in CSS.
I've not seem hyphens manual that I can recall. I have seen code to disable hyphenation. I don't see any reason not to add the hyphenation code to the CSS. But if it's an option, everybody will be happy. |
|
|
|
| Advert | |
|
|
|
|
#21 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 254
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
kepubverto now has a calibre plugin. It converts the EPUBs in your calibre library and adds the KEPUB to each book beside its EPUB, which it leaves unchanged. It hands kepubverto the EPUB exactly as it is stored, so the book never goes through calibre's own conversion. It has its own thread in the Plugins forum, with the download: https://www.mobileread.com/forums/sh...d.php?t=375915
Questions about the plugin (installing, the menu, the report, the settings) belong there. Questions about the conversion itself, what kepubverto does to a book, stay here. Quote:
Today, when hyphenation is turned on, kepubverto writes the rule into every chapter. It never changes the book's CSS files. The calibre plugin does not change that. Its Hyphenation setting (as the book says, on, off) is the same as --hyphens: it decides whether the book is hyphenated, not where the rule goes. With "on", the rule is still written into every chapter. Putting the rule in a CSS file instead means one of two things: changing one of the book's own CSS files, or adding a new CSS file to the book. Both need care. A book can have several CSS files, and different chapters can use different ones. I want to be sure the book stays valid before I offer it as an option, so I am not promising it yet. Until then, you can already get what you want: add the rule to the book's CSS yourself, and convert with hyphenation left as the book says (no --hyphens). kepubverto keeps your CSS exactly as it is, and the test in #19 showed that the Kobo reads the rule from a CSS file. https://github.com/veripublica/calib...ubverto-v0.1.0 https://github.com/veripublica/kepub...ses/tag/v0.3.0 https://crates.io/crates/kepubverto https://www.npmjs.com/package/@verip...epubverto-wasm |
|
|
|
|
|
|
#22 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,421
Karma: 154365103
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
delete post
Last edited by JSWolf; Yesterday at 07:21 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Libra Colour How to sort EPUB and KEPUB on Kobo | raydawson | Kobo Reader | 15 | 01-10-2025 06:33 AM |
| KEPUB and non-breaking space | Vetchy | Kobo Developer's Corner | 33 | 11-13-2024 02:44 PM |
| New Kobo, ePub vs Kepub | Pjama | Kobo Reader | 8 | 04-07-2021 12:26 PM |
| What will happen/I gain if I forced an ePub book to a KePub book? | andsoitgoes | Kobo Reader | 4 | 04-04-2012 04:33 PM |
| Kobo Adobe Epub is a Kepub instead | rashkae | Kobo Reader | 61 | 01-13-2012 06:15 AM |