Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2026, 01:23 PM   #1
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 215
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Can I set a default line-height in the config file?

Since switching from Kindle to Kobo, I've noticed that the Kobo doesn't seem to default to line-height: 1. A lot of the time, if the line-height isn't specified in the css, or even if it IS specified but only in body class, not p class, it defaults to something that looks more like 1.3 or so.

(And yes, this is with the line-height setting on my Kobo set as far to the left as it'll go. Also, my ebooks are all EPUB, not KEPUB, if that's relevant.)

Is there a tweak I can make to the config file to change this? It's frustrating to have to specify in the css that every p class should be set to line-height: 1, especially when the body class already says it.
Siavahda is offline   Reply With Quote
Old 07-24-2026, 01:25 PM   #2
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: 84,299
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
You have to edit the CSS to remove any line-height. Then you can have a default line-height. The problem is line-height in CSS can be all over the place. Same with overall L/R margins.
JSWolf is online now   Reply With Quote
Advert
Old 07-24-2026, 01:45 PM   #3
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 215
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Quote:
Originally Posted by JSWolf View Post
You have to edit the CSS to remove any line-height. Then you can have a default line-height. The problem is line-height in CSS can be all over the place. Same with overall L/R margins.
Sounds like it's probably the same amount of effort either way - either go in and set all the p classes to 1, or go in and remove any line-height settings. Sigh.

What would go in the config file, if I wanted to set a default line-height?
Siavahda is offline   Reply With Quote
Old 07-24-2026, 01:49 PM   #4
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by Siavahda View Post
Sounds like it's probably the same amount of effort either way - either go in and set all the p classes to 1, or go in and remove any line-height settings. Sigh.

What would go in the config file, if I wanted to set a default line-height?
Nothing. If there's no line-height in the css, Kobo will default to whatever you've set it in the device settings. If there is a line-height value in the css, Kobo will respect that.

I remove line-height values from the css and my Kobos always stick to the value I've set in the settings.

Of course fonts have their own line heights, so if you change the font, line-height will change as well.

Last edited by Sirtel; 07-24-2026 at 01:52 PM.
Sirtel is offline   Reply With Quote
Old 07-24-2026, 01:59 PM   #5
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 215
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Quote:
Originally Posted by Sirtel View Post
Nothing. If there's no line-height in the css, Kobo will default to whatever you've set it in the device settings. If there is a line-height value in the css, Kobo will respect that.
That's not matching my experience a lot of the time, like I said in the opener. Line-height set to 1 in the body class, no line-height specified in p class, my Kobo's line-height set as low as it'll go. And the Kobo doesn't display a line-height of 1, not unless I go in and add it to the css of every p class.

Or is this an EPUB/Kobo thing, it's not enough to have it in body class, it has to be in p class as well every time?
Siavahda is offline   Reply With Quote
Advert
Old 07-24-2026, 02:00 PM   #6
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
There is also a patch for forcing user line-height in epubs. I don't know if it works with Clara Colour. If it does, you won't need to edit your books.
Sirtel is offline   Reply With Quote
Old 07-24-2026, 02:01 PM   #7
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by Siavahda View Post
That's not matching my experience a lot of the time, like I said in the opener. Line-height set to 1 in the body class, no line-height specified in p class, my Kobo's line-height set as low as it'll go. And the Kobo doesn't display a line-height of 1, not unless I go in and add it to the css of every p class.

Or is this an EPUB/Kobo thing, it's not enough to have it in body class, it has to be in p class as well every time?
Well, I don't have it anywhere in the css. But then I also use the 24 line-height values patch, which decreases the default Kobo line-height values. So maybe it's the patch.
Sirtel is offline   Reply With Quote
Old 07-24-2026, 02:06 PM   #8
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: 84,299
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Sirtel View Post
Well, I don't have it anywhere in the css. But then I also use the 24 line-height values patch, which decreases the default Kobo line-height values. So maybe it's the patch.
With the Kobo Clara Colour, you have to use the 10-value line height patch as the 24 value patch doesn't work.
JSWolf is online now   Reply With Quote
Old 07-24-2026, 02:07 PM   #9
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: 84,299
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@Siavahda what you need to do it remove any line-height from the CSS. Then you need to adust the line height slider to what you want. It's that simple.
JSWolf is online now   Reply With Quote
Old 07-24-2026, 02:22 PM   #10
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by JSWolf View Post
@Siavahda what you need to do it remove any line-height from the CSS. Then you need to adust the line height slider to what you want. It's that simple.
And use the patch if you want to go lower than the default.
Sirtel is offline   Reply With Quote
Old 07-24-2026, 02:30 PM   #11
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: 84,299
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Sirtel View Post
And use the patch if you want to go lower than the default.
And with the 10-value line height patch, you can set the value you want to use.
JSWolf is online now   Reply With Quote
Old 07-24-2026, 03:14 PM   #12
John F
Grand Sorcerer
John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.John F ought to be getting tired of karma fortunes by now.
 
Posts: 8,273
Karma: 72602129
Join Date: Feb 2009
Device: Kobo Clara 2E
And if you are using calibre, I believe there is an option to remove line hight when doing a conversion.
John F is offline   Reply With Quote
Old 07-24-2026, 03:54 PM   #13
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,606
Karma: 14328510
Join Date: Nov 2019
Device: none
If you're using calibre to convert a kindle book to epub try and get calibre to remove as much crud as possible. You can also use calibre and do an epub to epub conversion with the purpose of removing the crud. Even that may not work for everything. In Sigil I also use the following single hairy regexp to remove lots of stuff. With these two steps the books all look the same on the Kobo. On the other hand a lot of nice formatting is destroyed; for example, too many authors use p tags for chapter titles and with this they're the same as the paragraph text.

Code:
(( )*display:( )*block;*
|( )*font-size:.*
|( )*letter-spacing:.*
|( )*line-break:( )*strict;*
|( )*line-height:.*
|( )*page-break-after:.*
|( )*page-break-before:.*
|( )*page-break-inside:.*
|( )*white-space:( )*pre-wrap;*
|( )*vertical-align:.*)
hobnail is offline   Reply With Quote
Old 07-24-2026, 05:26 PM   #14
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 15,587
Karma: 114630515
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by John F View Post
And if you are using calibre, I believe there is an option to remove line hight when doing a conversion.
I do convert all imports (even epub to epub) and use Calibre to automatically remove line-height and white-space. They and some other CSS are only for web sites.
Quoth is offline   Reply With Quote
Old 07-25-2026, 03:24 AM   #15
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: 84,299
Karma: 153715495
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hobnail View Post
If you're using calibre to convert a kindle book to epub try and get calibre to remove as much crud as possible. You can also use calibre and do an epub to epub conversion with the purpose of removing the crud. Even that may not work for everything. In Sigil I also use the following single hairy regexp to remove lots of stuff. With these two steps the books all look the same on the Kobo. On the other hand a lot of nice formatting is destroyed; for example, too many authors use p tags for chapter titles and with this they're the same as the paragraph text.

Code:
(( )*display:( )*block;*OH and cide,
|( )*font-size:.*
|( )*letter-spacing:.*
|( )*line-break:( )*strict;*
|( )*line-height:.*
|( )*page-break-after:.*
|( )*page-break-before:.*
|( )*page-break-inside:.*
|( )*white-space:( )*pre-wrap;*
|( )*vertical-align:.*)
That won't work because that's not the best way to convert Kindle eBooks to ePub. If you have KF8, you use KindleUnpack to make the ePub. If you have KFX, you use KFX Input to make the ePub.

Then you take the ePub and edit it in the editor or Sigil. You remove all unused CSS. You then go into the CSS and remove all line-height, all the body left/right margins. You do not bulk remove font-size. You have to know what it is you are removing first. Letter spacing also does not have to go. Page break can stay if it actually does something. White-space can also stay depending on what it does. And vertical-align can stay. You may or may not want to edit it. With a vertical-align, I set it to top so when there is a superscript, it won't go past the line it's in.

Bulk deleting is not always a good idea. There are very few cases here it's a good idea. You have to see the code in both CSS and HTML and see what it does.

And I left out that code, display, and block are not to be bulk deleted. For example, I've seen some cases where removing block and the class did not work as it should.
JSWolf is online now   Reply With Quote
Reply

Tags
config, kobo, line-height


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KFX: reduce default body line height on Kindle Zillion_ Conversion 3 08-19-2023 04:57 AM
How to set line height for book content? mzso Conversion 31 02-15-2018 01:35 PM
Fontconfig error: Cannot load default config file krischik Calibre 4 02-17-2012 09:48 AM
Default line-height in epubs Derek R ePub 2 02-13-2012 11:23 AM
Fontconfig error: Cannot load default config file kdbdallas Calibre 11 09-06-2010 05:32 PM


All times are GMT -4. The time now is 08:42 AM.


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