![]() |
#1 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Strange line-height issue
I bought a new Clara 2E. So far, so good. There are, however, some strange behaviour issues. One of them is this:
I use to enlarge the first letter of a chapter for decorative matters. The code ist: Code:
.first { font-family: "FoglihtenNo04"; font-size: 1.29167em; font-weight: bold; line-height: 0; letter-spacing: .1em; } Quote:
In the code, I changed various times the line-height (1, normal, 0, and other values), but there is always the too large space between the first and the second line. Even if I set the font-size to 1em, there is no change concerning the line spacing. Now, I have no more clue what I could do. Does someone have an explanation? Edit: The asterisks in the text are due to the soft-hyphens. |
|
![]() |
![]() |
![]() |
#2 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,844
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Here's a sample of the code I used at one time for dropcaps. It was a bit of a pain since the different x-heights of the letters were not accounted for and I finally gave on up on such decoration after I realized that I had a collection of dropcap-a to dropcap-z classes with varying right, left and bottom margins and while those looked good on my Forma, they were not optimal for any of my other ereaders.
Code:
.dropcap { float: left; font-size: 2.5em; line-height: 1.5; margin-bottom: -0.4em; margin-right: 0.05em; margin-top: -0.35em; } Code:
.first-letter1 { float: left; font-size: 250%; margin-bottom: -0.31em; margin-right: 0.05em; margin-top: -0.35em; } .first-letter2 { float: left; font-size: 250%; margin-top: -0.35em; margin-right: 0.05em; margin-bottom: -0.05em; margin-left: 0.22em; } .first-letter3 { float: left; font-size: 250%; margin-bottom: -0.31em; margin-right: 0.03em; margin-top: -0.35em; } .first-letter4 { float: left; font-size: 250%; margin-bottom: -0.31em; margin-right: 0.09em; margin-top: -0.35em; } .first-letter5 { float: left; font-size: 250%; margin-bottom: -0.31em; margin-right: 0.07em; margin-top: -0.35em; } .first-letter6 { float: left; font-size: 250%; margin-bottom: -0.31em; margin-right: 0.08em; margin-top: -0.35em; } |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Quote:
Code:
.scene { padding-bottom: 0.01em; padding-top: 2em; text-indent: 0; } .firstletterscene { font-size: 1.5em; line-height: 1em; } |
||
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,635
Karma: 145864617
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
![]()
Thanks all!
@DNSP: I'm aware that Dropcaps are no good idea for epubs. For a time, I was experimenting myself with them, but they render different on each device, and even on one single device it depends on the individual settings. But larger first letters are a different thing. A similar problem with too large a line space occurs with <sup>-tags. I usually achieved satisfactory results by setting the line-height to 0, but in the case described there is no difference. @Karellen: I'll give that a try, thank you. But what makes me wonder is that the code I use makes no problem on other devices, only on the Clara. I suspect that there is a sort of Kobo pre-setting that causes the issue rather than an erroneous code. @JSWolf: I don't know how larger first letters look on Kindle, but I would be interested, too, to have a look at it. Would you kindly (Kindle-y ![]() |
![]() |
![]() |
![]() |
#7 | |
Bookish
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,017
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
|
Quote:
Code:
* { margin: 0; padding: 0; line-height: normal; text-decoration: none; ... etc. } ![]() |
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
I tried with Karellen's suggestions, incorporating as well DrChiper's ideas. Karellen's code does not contain the font that I generally use, and when I insert it, the effect is the same as with my own code. Do I leave the font away, things become slightly better, but there still persists an enlarged space between the lines. Do I leave away the font in the code of my own, there is the same effect.
There are still other oddities: If you compare the chapter headings in the images of #1, you'll see that the chapter number in Calibre_View exceeds the frame, whereas in Clara_View it fits exactly into the frame. Originally, it has been just the other way round: fitting in Calibre's Viewer etc., the chapter number fell out of the frame downwards in the Clara. I reduced the font size and got the result as shown. What do we learn? Keep any decorative elements in epubs to a minimum, otherwise there will always be users that can not be satisfied. |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
One more test: I set the line height value of p to 1.2. Effect: the same.
|
![]() |
![]() |
![]() |
#10 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,635
Karma: 145864617
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Because a Kindle uses a fixed line-height and you cannot change the line height of the first line with the larger starting letter. So the first line will have a different line-height.
But publishers still do it even though it doesn't work because that's how the pBook was done. |
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
It looks fine on Kindle Previewer 3, though. But as these are my own books, not shared or made available for distribution, I only need to worry about what works for me. If I had a selection of ereaders, I'd probably try a bit harder and test, but that's not the case. ![]() |
|
![]() |
![]() |
![]() |
#12 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,635
Karma: 145864617
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#13 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,844
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
And yes, using a larger first letter opens pretty much the same can of worms that you will find when using an image for an historiated/illuminated dropcap. You might want to check Laura Franz's Drop Caps: Historical Use And Current Best Practices With CSS which is a decent introduction and review of some of the problems using dropcaps. After realizing that I was going to need multiple classes just for one device and likely a vist to media queries for multiple devices. A can of worms that I decided to forget about until such time as I have a couple of months/years to spare. Last edited by DNSB; 06-26-2023 at 12:23 PM. |
|
![]() |
![]() |
![]() |
#14 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,916
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
I regard them since 17th C as publisher egotism. You don't need them for a chapter or section start, because changing indent and top margin and prior heading does that. They also break up the first word and reduce reading comprehension.
Seeing then as I don't approve of them on paper I'd never implement them in an ebook and if I'm having to edit a book for other reasons I'll remove all drop cap styling. Easier taken out than fixed. Edit: Similarly the practice of using SMALL CAPS at the start of the paragraph at a new section is historic and now simply adds unwanted complexity and slows reading. Traditionally they are not even simply smaller caps, but a related face. Last edited by Quoth; 06-26-2023 at 04:28 PM. |
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
It seems to me that - at least the Kobo Clara - has a similar setting, so that one can increase the line-height by css, but reduce not exceeding a certain level. Might this be a topic for a patch?
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |