|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#2 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 215
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
What would go in the config file, if I wanted to set a default line-height? |
|
|
|
|
|
|
#4 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
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. |
|
|
|
|
|
|
#5 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 215
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
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? |
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#7 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
With the Kobo Clara Colour, you have to use the 10-value line height patch as the 24 value patch doesn't work.
|
|
|
|
|
|
#9 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#10 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,488
Karma: 248046301
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
|
|
|
|
|
|
#11 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
|
|
|
|
|
|
#12 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#13 |
|
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:.*) |
|
|
|
|
|
#14 |
|
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,587
Karma: 114630515
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
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.
|
|
|
|
|
|
#15 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
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. |
|
|
|
|
![]() |
| Tags |
| config, kobo, line-height |
|
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 |