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 07-26-2013, 05:20 AM   #1
met67
Connoisseur
met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.
 
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
Loading a custom CSS on kepub opening

Hi,

I've spent some (interesting...) time strace-ing nickel and found that, on every kepub opening, it searches for this file:
Code:
/mnt/onboard/.kobo/kepub/kepub-book.css
So I tried to create such a file with a single line like this:
Code:
* { -webkit-hyphens: auto; }
and voilà, every book I open gets hyphenated!

This could also used to force other properties like widows/orphans, margin, ecc. ecc.

Last edited by met67; 07-26-2013 at 07:10 AM. Reason: missing 'e'...
met67 is offline   Reply With Quote
Old 07-26-2013, 06:58 AM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,261
Karma: 74007256
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Interesting! Now let me ask what will appear a very stupid question

How do I get strace onto a Kobo for some more tracing?
PeterT is offline   Reply With Quote
Advert
Old 07-26-2013, 07:09 AM   #3
met67
Connoisseur
met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.
 
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
I downloaded strace from here, put it in /root, chmod-ed +x it and then used strace -p <pid> from telnet, with <pid> being the process id of nickel (use ps to get it)...
met67 is offline   Reply With Quote
Old 07-26-2013, 08:10 AM   #4
Anak
Fanatic
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 599
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Quote:
Originally Posted by met67 View Post
I downloaded strace from here, put it in /root, chmod-ed +x it and then used strace -p <pid> from telnet, with <pid> being the process id of nickel (use ps to get it)...
Interesting, but can you provide a more clear description on what and how to install and run it?
Anak is offline   Reply With Quote
Old 07-26-2013, 08:43 AM   #5
met67
Connoisseur
met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.
 
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
Quote:
Originally Posted by Anak View Post
Interesting, but can you provide a more clear description on what and how to install and run it?
I've opened a dedicated thread:
Running strace on Kobo
met67 is offline   Reply With Quote
Advert
Old 07-26-2013, 12:49 PM   #6
henriquemaia
Ignorant of many things
henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.henriquemaia can eat soup with a fork.
 
henriquemaia's Avatar
 
Posts: 63
Karma: 9304
Join Date: Feb 2011
Device: Kobo Libra 2
Quote:
Originally Posted by met67 View Post

[...]

So I tried to create such a file with a single line like this:
Code:
* { -webkit-hyphens: auto; }
[...]

This could also used to force other properties like widows/orphans, margin, ecc. ecc.
Out of curiosity:
How can one force other properties using that css file?
henriquemaia is offline   Reply With Quote
Old 07-26-2013, 01:58 PM   #7
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Is there something like this css for epubs too?
WS64 is offline   Reply With Quote
Old 07-27-2013, 04:05 AM   #8
met67
Connoisseur
met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.met67 can program the VCR without an owner's manual.
 
Posts: 78
Karma: 165868
Join Date: Jan 2012
Device: Nook Touch
Quote:
Originally Posted by henriquemaia View Post
Out of curiosity:
How can one force other properties using that css file?
It is hard to explain in a few words, it is just the way CSS works.

All the styles you include in this file are 'cascaded' (i.e. merged according to the CSS specification) with those of the ePub so that you can modify the overall result.
Note that CSS allows for styles to be marked with the "!important" keyword, to get higher priority in the style order.
met67 is offline   Reply With Quote
Old 07-27-2013, 07:06 AM   #9
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,261
Karma: 74007256
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Quote:
Originally Posted by WS64 View Post
Is there something like this css for epubs too?
From my observations last night, nope.
PeterT is offline   Reply With Quote
Old 07-27-2013, 07:59 AM   #10
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
Quote:
Originally Posted by WS64 View Post
Is there something like this css for epubs too?
OT; perhaps, but there are css for epub and others in the cr3engine portion of Koreader.

Luck;
Ken
Ken Maltby is offline   Reply With Quote
Old 07-27-2013, 08:50 AM   #11
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by henriquemaia View Post
Out of curiosity:
How can one force other properties using that css file?
I like especially
Code:
html {-epub-writing-mode: vertical-rl}
and
Code:
html {
    color:white;
    background-color:black;
}
In combination with kobolauncher or files monitor you can in this way toggle between sort of day/night mode and portrait/landscape.

Last edited by tshering; 07-27-2013 at 08:52 AM.
tshering is offline   Reply With Quote
Old 07-27-2013, 10:50 AM   #12
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Quote:
Originally Posted by PeterT View Post
From my observations last night, nope.
Thanks
WS64 is offline   Reply With Quote
Old 07-27-2013, 12:44 PM   #13
Anak
Fanatic
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 599
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
kepub-book.css seems to be epub3 complient. It accepts many css3 properties (if implemented). Including @rules like
Code:
@-epubx-viewport {width:610px !important;height:810px !important;}

Kepubs with an empty line after each paragraph can be fixed by adding this to the stylesheet.
Code:
p {padding-bottom:0 !important;}
Anak is offline   Reply With Quote
Old 07-27-2013, 09:11 PM   #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,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Anak View Post
kepub-book.css seems to be epub3 complient. It accepts many css3 properties (if implemented). Including @rules like
The reason for that is kepubs are read using the ACCESS renderer. This handles epub3 and is where the time is being spent to improve the support.
davidfor is offline   Reply With Quote
Old 07-30-2013, 05:07 AM   #15
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Do you know if the program GUI (nickel) look for a custom css as kepubs do?
Lucas Malor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-950 A little web too to generate custom CSS gsgleason Sony Reader 0 12-18-2011 06:51 PM
Custom CSS Japes Conversion 5 07-09-2011 08:15 PM
PRS-300 Stuck in Opening Book, Loading, restart cycle tiggertiffin87 Sony Reader 0 10-18-2010 08:33 PM
Custom CSS for output deckoff Calibre 1 08-28-2010 11:55 PM
Custom covers for Kobo's book loading screen? Gianorama Kobo Reader 7 07-28-2010 11:44 AM


All times are GMT -4. The time now is 07:12 AM.


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