Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2020, 04:17 PM   #1
mwexler
Member
mwexler began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2013
Device: None yet
4.x Viewer Line Spacing?

Hi, longtime 3.x user who finally upgraded to 4.13. Lots of things are faster and smoother, so thanks Kovid!

The biggest struggle I'm having is with the new Viewer. I got the toolbar and scrollbar back, configured my bottom row for page depth, and put it into Page (not flow) mode so it basically looks like 3.x (I do miss my page flip, but que cera).

But my epubs all seem really tightly line spaced in the new viewer. I tried a bunch of CSS snippets from the massive CSS thread (https://www.mobileread.com/forums/sh...ad.php?t=51500) (line-spacing, line-height) but none of them seemed to impact my test books. These are DRM free baen books, so I'm sure they have some CSS of their own, but still...

So, questions:
1) With an open book in the viewer, I add body {line-height:100 !important;} to the viewer in the text box under Preferences>Styles, but I don't see any difference in the book text. I've also verified in the Inspector that these values are appearing. No linespace change. Any suggestions? I'm sure I'm doing something wrong... Perhaps some additional "selectors" or tags or something?

2) How does using the "font size" controls affect this? Will whatever spacing I create grow appropriately as I increase font size, or should I just learn to squint more?

3) Are these style edits saved per book, or is this a systemwide viewer change? Would be nice not to have to do for every book, but would also be cool to have a way to have different overrides for specific book variables (this publisher may do something bad, or this series all has odd drop caps that screw up the flow, etc.). (I know, if it's just a single problematic book, edit the CSS manually in the editor, but I'm not that good yet!)

So, thanks for any suggestions!

Michael
mwexler is offline   Reply With Quote
Old 03-29-2020, 04:34 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
1 is very tight.
The common default is 1.2 (height of the current character space+.2
theducks is online now   Reply With Quote
Old 03-29-2020, 04:45 PM   #3
mwexler
Member
mwexler began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2013
Device: None yet
Right, 1 is tight; 1.2 is the default, but 100 should make it huge. No effect.

Update: I spent more time in the Inspector, and it would appear that I'm being overridden way deep down in some p tags.

So, this appears to have some impact, copied from another thread:
p {line-height:40px !important;}

Now I just need to understand if it's going to break anything. I assume px is pixels; should I use a percentage since that's more flexible? Any "recommended" way to do this?
mwexler is offline   Reply With Quote
Old 03-29-2020, 04:52 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by mwexler View Post
Right, 1 is tight; 1.2 is the default, but 100 should make it huge. No effect.

Update: I spent more time in the Inspector, and it would appear that I'm being overridden way deep down in some p tags.

So, this appears to have some impact, copied from another thread:
p {line-height:40px !important;}

Now I just need to understand if it's going to break anything. I assume px is pixels; should I use a percentage since that's more flexible? Any "recommended" way to do this?
Why is that there? No good reason? Remove it with the editor.

There are cases where I have reduced line-height that far. I was stitching together Image slices. But I sur can't see any other reason off the top-o-me bald head
theducks is online now   Reply With Quote
Old 03-29-2020, 04:53 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
But the thing is, in the eBook, do not set a line hight. Set it with the line height settings in the reading software.
JSWolf is offline   Reply With Quote
Old 03-29-2020, 05:10 PM   #6
mwexler
Member
mwexler began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2013
Device: None yet
Quote:
But the thing is, in the eBook, do not set a line hight. Set it with the line height settings in the reading software.
Right, I am setting line-height in the Calibre Viewer. As the original post said, I'm editing the custom CSS in the Viewer to make my collection of books look a bit better when I read them. In my ancient version of 3, the line spacing was a bit looser and easier to read than in this new v4 one, so I'm editing the Viewer to customize.

Quote:
Why is that there? No good reason? Remove it with the editor.
I'd prefer not to edit the books as I don't want to break them; the publisher and author put some work in there to already. But the Calibre Viewer, that's a great place to customize with no permanent damage, well, except to my eyes (ha!).

No one (well, I don't) wants a line spacing of 1; from my tests in a browser, line-height 100 defaults to 100 pixels, an "exaggerated for effect" test to see if I was making an impact. When I finally tried it in the p tag, you could see the 100 pixels for sure! I tried the px version because I found books specifying a height of 20px.

Reading through more threads, I'm now at this:
p {line-height:140% !important;}

This makes all the lines a bit more spaced than before; I haven't tested enough with "Font Larger" to see if it makes things too big.

I also haven't figured out yet how to add "skip a line after a paragraph" but I'm sure someone's thread will help.
mwexler is offline   Reply With Quote
Old 03-29-2020, 05:14 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
p {margin-top: .5em }
Spaces Paragraphs

I simply use Top vs Bottom because a bottom can possibly cause a blank screen for the last paragraph
theducks is online now   Reply With Quote
Old 03-29-2020, 10:44 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can read all abut how line-height works here: https://developer.mozilla.org/en-US/...SS/line-height
kovidgoyal is offline   Reply With Quote
Old 03-29-2020, 10:55 PM   #9
mwexler
Member
mwexler began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2013
Device: None yet
These are great, gang! Thanks!

I've wound up with

Code:
p {line-height: 1.4 !important;
   margin-top: 0.5em !important;}
which really helps (the unitless number version is the "preferred" option for line height, suggested via Kovid's pointer). Thanks for all the guidance, I learned a lot through this process.

PS: https://developer.mozilla.org/en-US/...CSS/margin-top for info about the margin-top value, via theducks.
mwexler is offline   Reply With Quote
Old 03-30-2020, 06:51 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by mwexler View Post
These are great, gang! Thanks!

I've wound up with

Code:
p {line-height: 1.4 !important;
   margin-top: 0.5em !important;}
which really helps (the unitless number version is the "preferred" option for line height, suggested via Kovid's pointer). Thanks for all the guidance, I learned a lot through this process.

PS: https://developer.mozilla.org/en-US/...CSS/margin-top for info about the margin-top value, via theducks.
IMHO wrapping your head around the 'HTML/CSS Box Model' will do wonders in solving many STYLE issues.

The Editor HAS an Inspector mode (View: Inspector) where it can show a visual of the Box properties for the selected code block/
Attached Thumbnails
Click image for larger version

Name:	Inspector.PNG
Views:	152
Size:	107.9 KB
ID:	178023  
theducks is online now   Reply With Quote
Reply

Tags
css, line spacing, viewer


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pdf line spacing in Calibre Viewer sanon Library Management 4 04-20-2016 07:07 PM
Line Spacing Francois Driesen Calibre 2 08-22-2014 02:21 PM
Line Spacing Nikita Jedi Conversion 11 07-07-2012 07:05 PM
7.34 line spacing??? JSWolf Calibre 18 12-19-2010 11:09 PM
Line spacing Ivo Kobo Reader 3 06-30-2010 12:54 PM


All times are GMT -4. The time now is 04:38 AM.


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