03-20-2012, 06:09 AM | #1 |
Addict
Posts: 320
Karma: 99999
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
|
Coolreader Epub support: CSS and hyphenation
On my M92 (with Firmware 1.6), I love Cool Reader's ability to split the screen into two pages when reading Epubs in horizontal mode. But Cool Reader doesn't handle (German) hyphenation correctly (e.g. FPReader does!). And Cool Reader seems to ignore the stylesheets that come with an Epub.
This is the Epub I'm reading at the moment: https://www.mobileread.com/forums/showthread.php?t=42471 Here, the chapter headings (<h3>-tags) are not styled at all in Cool Reader, even though I tried to change the style in the included Epubs in many ways. Especially, Cool Reader ignores "page-break-before: always;". And hyphenation is bogus - that means that Cool Reader inserts hyphens randomly, e.g. "seinesgle-ichen", "Leh-nstuhl", "allaben-dlich", "Marqu-is", "Höflichke-it". Strangely enough some hyphens are placed correctly - though I don't know if on purpose. Anyway, in FBReader I checked more than 50 pages and couldn't find a single wrong hyphenation, especially not in those words cited above. What's the reason for this? How is hyphenation handled in FBReader? Why does it ignore CSS? Has it been fixed already for 1.7? Last edited by tuxor; 03-20-2012 at 06:11 AM. |
03-20-2012, 12:22 PM | #2 |
Addict
Posts: 320
Karma: 99999
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
|
Strangely enough, the hyphenation patterns are hardcoded to English and Russian: https://github.com/onyx-intl/boox-op...rc/hyphman.cpp and https://github.com/onyx-intl/boox-op...lude/hyphman.h - even though the hyphenation patterns for German actually exist in the git repository: https://github.com/onyx-intl/boox-op...onyx/data/hyph
Why did they do that? Is it possible to use German hyphenation without recompiling Cool Reader? When recompiling Cool Reader with German hyphenation patterns will I lose support for English hyphenation? I added a point to our wishlist in the wiki concerning hyphenation in Cool Reader The problem about ignoring *css-files can be solved by placing the file from https://github.com/onyx-intl/boox-op.../data/epub.css in the directory "cr3" in the internal storage. Last edited by tuxor; 03-20-2012 at 12:25 PM. |
Advert | |
|
03-20-2012, 12:26 PM | #3 |
Wizard
Posts: 2,806
Karma: 13500000
Join Date: Nov 2009
Location: Portland, OR
Device: Boox PB360 etc etc etc
|
nice work finding the fix for the css issue
|
03-20-2012, 01:10 PM | #4 |
Addict
Posts: 320
Karma: 99999
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
|
Thanks.
At least, I was able to disable hyphenation: simply edit the "epub.css" (from the last paragraph of my post #2) by changing the first line as follows: Code:
body { text-align: left; text-indent: 0px; hyphenate: none; } Last edited by tuxor; 03-20-2012 at 01:38 PM. |
03-20-2012, 01:38 PM | #5 |
Addict
Posts: 320
Karma: 99999
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
|
Ok, that's the solution: You take your desired hyphenation file from https://github.com/onyx-intl/boox-op...onyx/data/hyph, place it in (newly created) folder /usr/share/cr3/hyph on your M92 and rename it to "Russian_EnUS_hyphen_(Alan).pdb". You might need ssh or serial connection to your M92 for this.
Unfortunately this solution needs some know-how. Would appreciate if somebody could give an easier solution, so that board members with less computer expertise can make use of this solution as well (Make sure hyphenation is not disabled like explained in #4!) |
Advert | |
|
03-23-2012, 09:09 AM | #6 |
M92 info archivist
Posts: 238
Karma: 1398
Join Date: Jun 2008
Device: IRex Iliad 2nd ed., Onyx Boox M92, Onyx Boox Max Lumi
|
...added info and links to Software and Tweaks wiki (hinthint )
@tuxor: thx for contributing to the wishlist wiki Cheers. |
03-27-2012, 09:18 AM | #7 |
Addict
Posts: 320
Karma: 99999
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
|
Hm, my "workaround" is not really a workaround. Coolreader does use the "epub.css" file described above. But it still ignores any CSS-directives inside the Epub file.. Is this intended?
Code:
<h1 style="text-align:center;">Test<br />heading<br />just for fun</h1> Code:
Test heading just for fun EDIT: Forget about what I wrote after that, I found out, text-transform, :first-letter etc. are not part of the Epub specification. Last edited by tuxor; 03-27-2012 at 09:50 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Orizon Firmware v 3.1 hyphenation support. What's up? | DHille | Bookeen | 3 | 07-16-2011 11:49 AM |
How can I make a left-justify CSS for CoolReader? | Sunspark | Astak EZReader | 1 | 06-07-2010 11:00 AM |
Tinkering With Coolreader CSS (and Some Original Writing For Yew) | ThomasMcKean | Astak EZReader | 20 | 05-11-2010 10:42 AM |
.CSS [CoolReader] Programming Demystified | Dr. Drib | Astak EZReader | 6 | 03-18-2010 01:27 AM |
fb2 hyphenation in coolreader | leandroide | HanLin eBook | 3 | 02-23-2009 03:13 PM |