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 06-27-2023, 09:11 AM   #16
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
I just realized that there exists something like a patch for this, but with the aim of expanding the possibilities of line-spacing of the device. In fact, however, the pre-setting for the first line is always added to the chosen line-height values. Not really helpful in my case.
Leonatus is offline   Reply With Quote
Old 06-27-2023, 11:57 AM   #17
Anak
Guru
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: 603
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
If you convert regular epubs to kepubs you can try somtething like:

In the CSS
Define the default behaviour of a class, i.e. "chapter-start":
Code:
.chapter-start{
margin-top : 1em;
text-indent : 0;
}
and automatically beautify this class with:
* first letter only,
Code:
.chapter-start::first-letter {
font-family : sans-serif;
font-size : 120%;
font-weight : bold;
}
and/or
* the first line of text, not the whole text bewteen <p class="chapter-start"> … </p>
Code:
.chapter-start::first-line {
font-family : "Bookery", serif;
font-size : 100%;
font-variant : normal;
text-transform : uppercase;
}
You do not need a separate class for dropcaps, thats done by ::first and/or ::first-line pseudo-elements.
.
.xhtml file example (using the classes defined in the css)
Code:
<p class="chapter-start">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Elit sed vulputate mi sit amet mauris commodo quis. Egestas egestas fringilla phasellus faucibus scelerisque. Platea dictumst quisque sagittis purus sit amet volutpat consequat mauris. Placerat vestibulum lectus mauris ultrices eros in cursus turpis. Sit amet justo donec enim. Urna nunc id cursus metus aliquam eleifend mi in. Facilisi etiam dignissim diam quis enim lobortis scelerisque fermentum dui. Maecenas accumsan lacus vel facilisis volutpat est velit egestas dui. Pharetra et ultrices neque ornare aenean euismod elementum nisi quis. Id velit ut tortor pretium. Sapien et ligula ullamcorper malesuada proin libero nunc consequat. Sagittis eu volutpat odio facilisis mauris. Nec feugiat in fermentum posuere urna nec tincidunt. Arcu risus quis varius quam. Cras pulvinar mattis nunc sed blandit libero volutpat sed. Sed cras ornare arcu dui vivamus arcu felis bibendum.</p>

<p class="indent">Diam quam nulla porttitor massa id neque aliquam. Cras sed felis eget velit aliquet sagittis id consectetur purus. Eget magna fermentum iaculis eu. Neque laoreet suspendisse interdum consectetur libero id faucibus. Nec feugiat in fermentum posuere urna nec tincidunt. Netus et malesuada fames ac turpis egestas. Consequat nisl vel pretium lectus quam id leo in vitae. Sed felis eget velit aliquet sagittis id consectetur. Massa tempor nec feugiat nisl. In ornare quam viverra orci sagittis. Leo vel fringilla est ullamcorper eget nulla facilisi. Convallis a cras semper auctor neque.</p>
Sigil will show you a good preview of the above code.

Note: CSS pseudo-elements are also supported by Adobe Digital Editions/Adobe Reader Mobile (RMSDK) for epub3 files.
However, Kobo has not implemented the latest (or a more recent) version of RMSDK, that's why it does not work with plain .epub (epub3) files on Kobo ereaders.

Perhaps one day Kobo will update the outdated RMSDK release.

Last edited by Anak; 06-27-2023 at 12:00 PM.
Anak is offline   Reply With Quote
Advert
Old 06-28-2023, 02:44 AM   #18
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Thank you, Anak, for your advice! They are mainly based, you say it yourself, on pseudo-elements. I have given up to work with them for a long time, as there are many devices that have problems with them. And as my books are mostly aimed to be uploaded here, I try to avoid disturbances. But, for the use of my own, I shall try it.
By the way: My own books are transformed into Kepubs by j.goguen's extended driver.
Leonatus is offline   Reply With Quote
Old 06-28-2023, 05:14 AM   #19
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
I tried it, but the space between the lines persists. I still suspect that it is the assembly of the Clara itself that causes the issue. I should consider to remove any decorative text elements.
Leonatus is offline   Reply With Quote
Old 06-28-2023, 05:25 AM   #20
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: 79,778
Karma: 145864619
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 Leonatus View Post
I tried it, but the space between the lines persists. I still suspect that it is the assembly of the Clara itself that causes the issue. I should consider to remove any decorative text elements.
Can you show us the code that's causing the problem?
JSWolf is offline   Reply With Quote
Advert
Old 06-28-2023, 05:59 AM   #21
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
I thought I had basically explained everything in #1, to which you had already left a comment. My purpose was to enlarge somewhat the first letter of a chapter by using the <span class="first">-tag. Is there still something missing to be clarified?
Leonatus is offline   Reply With Quote
Old 07-01-2023, 04:02 AM   #22
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
I made a new test, setting the line-height of the whole paragraph to 0, with the result that all lines melted into one, and leaving only the first line to exceed a little. No doubt that the first letter has an - obviously unchangeable - effect on the height of the first line.
Leonatus is offline   Reply With Quote
Old 07-01-2023, 04:10 AM   #23
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: 79,778
Karma: 145864619
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 Leonatus View Post
I made a new test, setting the line-height of the whole paragraph to 0, with the result that all lines melted into one, and leaving only the first line to exceed a little. No doubt that the first letter has an - obviously unchangeable - effect on the height of the first line.
You just want the span to have a line height of 0.

CSS:
Code:
.bigletter {
  font-size: 1.5em;
 line-height: 0;
}
.noindent {
  text-indent: 0;
}
HTML:
Code:
<P class="noindent"><span class="bigletter">T</span>This is a test."</p>

Last edited by JSWolf; 07-01-2023 at 04:12 AM.
JSWolf is offline   Reply With Quote
Old 07-01-2023, 04:18 AM   #24
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Thank you! My own code of the first letter is:
Code:
.first {
  font-family: "FoglihtenNo04";
  font-size: 1.29167em;
  font-weight: bold;
  line-height: 0;
  letter-spacing: .1em;
}
That seems to me quite similar to yours, or do I miss something?
Leonatus is offline   Reply With Quote
Old 07-01-2023, 04:23 AM   #25
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: 79,778
Karma: 145864619
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 Leonatus View Post
Thank you! My own code of the first letter is:
Code:
.first {
  font-family: "FoglihtenNo04";
  font-size: 1.29167em;
  font-weight: bold;
  line-height: 0;
  letter-spacing: .1em;
}
That seems to me quite similar to yours, or do I miss something?
I find numbers like 1.29167 to be silly. Why not just use 1.3? Also, you don't need letter-spacing as it's only one letter. But otherwise, it's similar and will work to fix the first line's larger height.

Last edited by JSWolf; 07-01-2023 at 04:26 AM.
JSWolf is offline   Reply With Quote
Old 07-01-2023, 06:49 AM   #26
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Quote:
Originally Posted by JSWolf View Post
I find numbers like 1.29167 to be silly.
Right, but I didn't choose it myself. When i work my books out with Sigil and Calibre, at last such values seem to appear automagically, and I eventually refrain from changing them.
And to the rest: no, there is no effect to the line height.
The letter spacing I chose, because the font I use has sometimes certain ornaments that reach to the next letter.
Edit: I tried the code also at the Tolino, where there is no issue at all.

Last edited by Leonatus; 07-01-2023 at 06:52 AM.
Leonatus is offline   Reply With Quote
Old 07-01-2023, 07:02 AM   #27
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: 14,081
Karma: 105211945
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by JSWolf View Post
I find numbers like 1.29167 to be silly. Why not just use 1.3? Also, you don't need letter-spacing as it's only one letter. But otherwise, it's similar and will work to fix the first line's larger height.
It's maybe 15.5 pt. Some numbers just look strange to humans. Actually 15.5 pt converted to em is 1.2916666666 repeating 6, so rounds to 1.29167
It's not true for paper (where an em makes less sense), but for ebooks (maybe only) 1em = 12pt. All margins, fonts and padding should be in em for ebooks, or at worst pt (though pt doesn't work correctly for margins on kepub, does for mobi, azw3/KF8 and epub on almost everything as 12pt = 1em)
Only paper should use inches, centimetres etc.
Nothing should use rem or pica

Edit:
Text, margins or padding should not use px or %
The px or % are for images on ebooks.

Last edited by Quoth; 07-01-2023 at 11:48 AM.
Quoth is offline   Reply With Quote
Old 07-01-2023, 07:47 AM   #28
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,055
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
Quote:
Originally Posted by Quoth View Post
It's maybe 15.5 pt. Some numbers just look strange to humans. Actually 15.5 pt converted to em is 1.2916666666 repeating 6, so rounds to 1.29167
I assumed something like that, kind of translation.
Quote:
Nothing should use rem or pica
px or % for images on ebooks.
Do I understand correctly? Percent should not be used for images? This would be new to me.
Leonatus is offline   Reply With Quote
Old 07-01-2023, 11:47 AM   #29
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: 14,081
Karma: 105211945
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by Leonatus View Post
I assumed something like that, kind of translation.

Do I understand correctly? Percent should not be used for images? This would be new to me.
No, mostly px.
Sometimes the css might have auto for width and a % for height, or vice versa if you want the image to be as big as possible. The enclosing <p or <div would have zero margins and centre as if styling text.
No auto for margins.
The don't use was rem and pica
The px and % ONLY for images, not text.

Edited ambigious & confusing post. Sorry.

Last edited by Quoth; 07-01-2023 at 11:49 AM.
Quoth is offline   Reply With Quote
Old 07-01-2023, 12:03 PM   #30
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,288
Karma: 169098402
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Quoth View Post
It's not true for paper (where an em makes less sense), but for ebooks (maybe only) 1em = 12pt.
Oddly, I still have my trusty line gauge (pica stick, em ruler, etc.) from a long ago era when we used Linotypes to generate the text and then manually laid out the pages before photographing them for the actual printing process. Not a trace of computers in the process. And yes, 1 em was 1 pica was 12 pts was the way the sizes were stated. I never managed to use the agate measurement running down the center of the gauge. Also, this was prior to the computer folks redefining 72 pts as 1 inch instead of the 72.27 pts used in the typesetting business.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Line height issue Mercador Kobo Reader 19 07-21-2020 02:32 PM
CSS line height vs Kobo line spacing slider? bongoman Kobo Reader 2 07-12-2020 01:25 PM
Strange first line of chapter issue in kepub bongoman Devices 2 07-09-2020 07:21 AM
line height Rellwood Conversion 3 04-07-2018 04:34 AM
Kindle for iOS (AZK format) - line height issue heulwen.jones Kindle Formats 7 05-12-2016 12:24 AM


All times are GMT -4. The time now is 03:57 PM.


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