![]() |
#1 |
Boo-Frickety-Hoo-Erizer
![]() ![]() ![]() ![]() ![]() ![]() Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Css Drop Caps does not work in an Epub on a Reader
CORRECTION/EDIT:
CSS DROP CAPS DO WORK IN AN EPUB ON A READER Message 54 of this thread has an epub that it all works in. If you use Calibre to create it using this solution, set your base font size to Zero to make it work correctly there. Rest of thread preserved for posterity. Thanks to all who made it work: Jelby, Llasram, Peter Sorotokin, and Kovid Goyal. -bjc ///////////////////////////////////////////////////// At least, I haven't seen it. Attached is what happens with this code: css: span.first { font-variant: small-caps; margin-left: -0.5em; } span.drop { font-size: 400%; font-weight: bold; line-height: 0.75; float: left; margin: 0 0.125em 0 0; } xhtml: <p><span class="first"><span class="drop">I</span>n</span> the ancient city of London...</p> Now the idea that Sony needs to change their code-interpretation is probably indisputable, but who is going to call Sony and correct them? And then get them to distribute a fix? Or Adobe (DE has the same problem)? C'mon, guys, prove me wrong. Oh, and showing something work in a browser on a computer doesn't count. -bjc Last edited by brewt; 01-18-2009 at 03:41 PM. |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I don't have a Sony to try, but I'm the author of the ePUB example.
I'm pretty sure the problem is that the reader interprets "line-height: 0.75" by lowering the top "border", while browsers typically raise the whole "block" (the drop cap in this case). I don't claim to be a CSS expert, far from it... I'm not even sure what the correct behaviour could be. Maybe I should add a "vertical-align: top" property? Could you try it? What I'm sure it's doing wrong is rendering the "I - The Birth of the Prince and the Pauper" line, it should be ignored in the text flow (and, ideally, displayed as a page header from the next page). |
![]() |
![]() |
![]() |
#3 |
book creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Obviously you're right, Jellby. Sony uses the ADE rendering engine and we knew about this same problem as we have talked about it before. Sony, therefore, generally just reacts the way ADE does.
|
![]() |
![]() |
![]() |
#4 | ||
Boo-Frickety-Hoo-Erizer
![]() ![]() ![]() ![]() ![]() ![]() Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Quote:
Quote:
The Sony Ebook Software is a reasonable simulator for what happens on a Reader. It doesn't care so much about the 300k limit that a real Reader does, but otherwise it's close, if you want to try it. Oh wait. The Sony stuff is Windows only, and you're running on Linux, if I recall. But again, I would be delighted to try it, if you wish. -bjc |
||
![]() |
![]() |
![]() |
#5 | |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
Instead, try setting a 'line-height' of 1em and a 'height' of 1em. That should force the size of the block and line-box to be the same. That said, you probably don't want to set the font size to 400% -- that's 4x the font-size, but the default 'line-height' is probably more than 1.0. The only way to get consistent results is to set the default line-height to a value you control such as 1.2, then you can set the font-size in the drop-cap to something like 4.8em to force it to be 4 lines tall. |
|
![]() |
![]() |
![]() |
#6 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I didn't take it that way, don't worry.
Quote:
Quote:
So, we need to find a compromise. I think it could be enough to combine your suggestion with a negative top-margin, so I propose this: Code:
span.drop { font-size: 400%; font-weight: bold; float: left; margin: -0.15em 0.125em 0 0; line-height: 1em; height: 1em; } |
||
![]() |
![]() |
![]() |
#7 |
book creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
This is ADE. No changes I guess
|
![]() |
![]() |
![]() |
#8 |
book creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Calibre looks fine
|
![]() |
![]() |
![]() |
#9 | |||
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
Quote:
Quote:
I apparently should have tested what I was proposing, and I apologize for not having done so :-/. As already posted, no change. However, playing around with it, I discovered that the culprit is the negative left margin on 'span.first'. I hesitate to theorize why ADE doesn't want to float the float before text which is pulled left of the left margin / into the box occupied by the float, but there you go. |
|||
![]() |
![]() |
![]() |
#10 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#11 |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
It's linked to from this Adobe knowledgebase article. You can ignore all the directions and just wine the exe without any special setup.
|
![]() |
![]() |
![]() |
#12 |
Boo-Frickety-Hoo-Erizer
![]() ![]() ![]() ![]() ![]() ![]() Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Poking through Adobe, it seems they knew the drop cap codes wouldn't work a year-and-change ago:
http://blogs.adobe.com/digitaleditio...ntent_for.html Posted by: Joseph Gray | October 26, 2007 10:54 PM I'll look at the drop cap code. It's most likely a bug in the Digital Editions. All of these properties are supported and should work. Support for justification is optional per W3C CSS spec and support for margin value of auto is optional per IDPF OPS spec. We are planning to implement them at some point, but you can never rely on a reading system to support those. I'm reasonably sure there's been an update or two since 10/07 to ADE, so, this hasn't been on the priority list. And, as long as we're at it: Posted by: Kuldeep Kumar | December 23, 2008 01:35 AM There is no way to turn off page number marks at this point, but it is on our list. Confession is good: Posted by: vuchrfvdvr | October 1, 2007 10:46 AM Some other CSS that doesn't seem to work in Digital Editions are the following: text-align: justify; margin-left: auto; margin-right: auto; More on the party line: http://blogs.adobe.com/digitaleditio..._editions.html -bjc |
![]() |
![]() |
![]() |
#13 |
book creator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Justify works fine with the Calibre epub engine.
|
![]() |
![]() |
![]() |
#14 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
So let's check it, how does this one look? (check chapters IX and XXXII too, they should have a larger negative indent in the first line). |
|
![]() |
![]() |
![]() |
#15 |
Boo-Frickety-Hoo-Erizer
![]() ![]() ![]() ![]() ![]() ![]() Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Gettin' close - I'll add more screen shots later......
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
ePub to ePub - just replace CSS? | ChristopherTD | Calibre | 21 | 02-11-2010 02:50 AM |
newbiq Q about Drop Caps and Calibre | NASCARaddicted | Calibre | 2 | 01-14-2010 07:03 PM |
Using CSS in Word to make a Drop Cap work in an Epub | brewt | ePub | 3 | 01-31-2009 06:00 PM |
css drop caps coming out of calibre | brewt | Calibre | 3 | 01-18-2009 04:00 PM |