![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
CSS Help Please
Ok, so I have PRS+ installed on my Sony readers. Below is an example CSS file for one of the fonts that I installed. The problem is that, regardless of what I set line height to, nothing at all seems to actually change with regards to line height. I've tinkered with making it huge (just to see if it changes anything) and tiny, and nothing changes. Can anyone help?
Could it be that, in Calibre, when I convert to Epub, in "Look and Feel" I have Base Font Size set to 11.5pt and Line Height set to 13 pt? Is the CSS unable to override this? Is there any way around this without having to reconvert the thousands of books in my library? @font-face { font-family: "Vollkorn"; font-weight: normal; font-style: normal; src: url(res:///Data/fonts/Vollkorn-Regular.ttf); } @font-face { font-family: "Vollkorn"; font-weight: bold; font-style: normal; src: url(res:///Data/fonts/Vollkorn-Bold.ttf); } @font-face { font-family: "Vollkorn"; font-weight: normal; font-style: italic; src: url(res:///Data/fonts/Vollkorn-Italic.ttf); } @font-face { font-family: "Vollkorn"; font-weight: bold; font-style: italic; src: url(res:///Data/fonts/Vollkorn-BoldItalic.ttf); } body { font-family: "Vollkorn"; line-height: 1.9em } p { line-height: 1.9em !important; text-indent: 1.5em !important; } html { font-family: Vollkorn !important; } .mainBody { font-family: Vollkorn !important; } .calibre { font-family: Vollkorn !important; } |
![]() |
![]() |
![]() |
#2 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
And, if I DO end up having to re-convert everything in my library, is there a way to select an "Input" of anything OTHER than Epub?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Yes. You can select any input for individual conversions. For bulk conversions, you don't set "the" input you select a preferred order for inputs. By default that order is set to EPUB first, followed by about 30 other formats, but you can set it to any order you want with Preferences | Behavior | Preferred Input Order.
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
Cool. Thanks for that. I found it and adjusted it.
Now, anyone know the answer to the first post? |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Not having a Sony, I skipped over it, but for my Android reader software, I can tell them to read/use the book's CSS or override that CSS with reader supplied formatting. Is your reader software using its own CSS or CSS stored in the EPUB?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
It appears to be using the reader supplied CSS for some things (like the font) but the reader supplied CSS doesn't appear to override the line height.
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
Kovid, can you chime in here?
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,195
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You will have a very hard time overriding css using generic selectors like that. CSS rules have rather complex priority calculations which are used to determine what will override what.
|
![]() |
![]() |
![]() |
#9 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
There has to be a way to do it, though, without re-converting everything in my library, right?
I say that, because, for example, on the new Nook, in SPITE of the Calibre settings, you can change line spacing and margins, etc. So, there has to be a way to do it. Can you please let me know? |
![]() |
![]() |
![]() |
#10 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
Kovid, I just looked more closely at what you wrote and let me clarify something. Everything BUT the line height is apparently being overridden. The ONLY thing that isn't being overridden is line height. So the generic selectors are working on most everything. How come?
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,195
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Because there is a higher priority selector that is applying the line height. Open your epubs and look for it.
|
![]() |
![]() |
![]() |
#12 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
So basically nothing can be done except for re-converting everything, without any line height set?
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
I could be wrong, but I'm not sure that reconverting an epub will remove line-height attributes which are already in the epub. The Calibre Look&Feel page could be used to change the value assigned to line-height but not to remove it altogether.
The guaranteed way to make sure your on-device CSS line-height is used is to use Tweak-epub to edit the css file and physically remove the line-height parts. Tedious but simple. Edit: Oh and make sure that your Calibre conversion settings are such that line-heights are not added to epubs which didn't have them in the first place. Last edited by jackie_w; 06-23-2011 at 02:04 PM. Reason: afterthought |
![]() |
![]() |
![]() |
#14 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 303
Karma: 1033852
Join Date: Jun 2011
Device: Sony PRS-350,Sony PRS-950,Pocketbook 360+,B&N Nook Simple Touch Reader
|
I meant reconvert from the original source (Lit, Mobi, etc). But, I was hoping there was a simpler solution and, I'm convinced there is, otherwise, the Nook would be unable to alter line heights, etc, "on the go." I just know nothing about this CSS stuff (or any programming in general).
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
It's possible the Nook reading app deliberately ignores any occurrences of line-height, font-family etc in each epub so it can use the user-specified Nook settings.
Last edited by jackie_w; 06-23-2011 at 02:19 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Override ePub CSS with userStyle.css? | barium | Sony Reader Dev Corner | 11 | 07-16-2011 03:25 PM |
CSS Help Please | Japes | Sony Reader | 26 | 06-23-2011 10:40 AM |
CSS help? | graycyn | ePub | 2 | 06-16-2011 04:56 AM |
epub CSS versus "Regular" CSS | konrad | ePub | 4 | 02-18-2011 09:29 AM |
css pseudo elements and adjacent combinators in extra css? | ldolse | Calibre | 2 | 12-21-2010 05:09 PM |