Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-20-2025, 05:42 AM   #16
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,758
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 rjwse@aol.com View Post
That is just your opinion. Dropcaps and raised caps are an under-the-surface psychological reminder that something more than just a new paragraph is about to begin. No, they are not absolutely necessary, but neither is enlarged and/or centered type for H1, H2 or anything else. We could get by writing teletype, all in caps without extended ascii, with ragged right margin, etc. Dropcaps are like picture frames on an oil painting — don't absolutely need them. Shakespeare never specified, "Hey, put in a dropcap here." But they are more than 'de frivole.' I would be more inclined to shitcan the needlessly expensive school textbook racket in favor of public domain, free textbooks in ebook format than get rid of dropcaps. I would like to see crippled, poorly designed ereaders catch up with all the new code. (Just my opinion; I'm feeling grumpier than usual today; no offense intended.)
Can you tell me how to make a dropcap look good if I change the font, change the font size, and/or change the line height?
JSWolf is offline   Reply With Quote
Old 06-20-2025, 08:26 AM   #17
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 322
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
Quote:
Why, yes. That is my opinion and one I feel entitled to hold. From when I was working in the Ubyssey newspaper...
That settles it. then. The world-renouned Ubyssey newspaper is our standard.
rjwse@aol.com is offline   Reply With Quote
Old 06-20-2025, 10:23 AM   #18
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by JSWolf View Post
Can you tell me how to make a dropcap look good if I change the font, change the font size, and/or change the line height?
Jon - we understand you don’t think they look good. Nothing we say (or have said many times) will change your mind. If you really want to know, then please re-read (or maybe read for the first time) the directions given many times before…
Turtle91 is offline   Reply With Quote
Old 06-20-2025, 01:42 PM   #19
Falkor
Connoisseur
Falkor began at the beginning.
 
Posts: 89
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
Quote:
Originally Posted by Quoth View Post
The secret is to realise that the ebook specs started out simply for simple novels with either images in their own paragraph and centred, or small. In both cases no frame in MS Word/LO Writer and "anchor as character". Superscript and subscript work if carefully styled. Forget things like SMALL CAPS, raised caps, drop caps; anyway many readers don't like them they reduce reading comprehension and have erratic support. Accessibility is important, so alt text for every image and not trying to be clever or fancy.

If you are doing a text book, or fancy stuff in epub3, accept that it won't work for many and widespread commercial distribution will either be rejected or cause problems for purchasers.
Personally, I consider them to be electronic books – so one should be able to style them somewhat like a book.

The "fancy" stuff is usually not that difficult. "Initial-letter" works pretty well and is widely supported – I don't have any reading app that doesn't support it. If it's not supported by a renderer it's not a big deal either. It can simpy be ignored (though I really think this absolutely needs to be supported on modern reading devices. Drop caps and raised caps are widely used and initial-letter is great solution for all the problems everybody is having with them).

Mirrored text (with an svg wrapper) works flawlessly for me as well.

On the other hand I've been trying to keep images and captions together on one page with <figure> and <figcaption>. Sounds very basic, but it's surprisingly challenging. With four different reading applications I can get four different results. They all behave very differently.

Also page breaks: epub is a format for books. The content is almost always displayed as pages. Yet the concept of pages is not even implemented into many readers and they use columns instead–and the two concepts may clash. Setting pagebreaks with CSS should really be quite simple. But the only way to make them work consistently in all reading apps is by splitting up the document.

Quote:
Originally Posted by JSWolf View Post
Can you tell me how to make a dropcap look good if I change the font, change the font size, and/or change the line height?
That's what the "initial-letter" property is for. You set the size and sink and the renderer calculates the actual height and placement depending on the line height and font size.
Attached Thumbnails
Click image for larger version

Name:	initial-letter-1.png
Views:	24
Size:	49.4 KB
ID:	216384   Click image for larger version

Name:	initial-letter-2.png
Views:	23
Size:	53.6 KB
ID:	216385   Click image for larger version

Name:	intial-letter-3.png
Views:	21
Size:	131.5 KB
ID:	216386  
Falkor is offline   Reply With Quote
Old 06-20-2025, 02:39 PM   #20
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 63
Karma: 10
Join Date: May 2025
Device: iPad
Quote:
Originally Posted by Falkor View Post
On the other hand I've been trying to keep images and captions together on one page with <figure> and <figcaption>. Sounds very basic, but it's surprisingly challenging. With four different reading applications I can get four different results. They all behave very differently.
May I ask, what is your solution to that? I haven't had any success with that and ended up putting the caption into the image as grafical part of it - not a very pretty solution.
Slevin#7 is online now   Reply With Quote
Old 06-20-2025, 03:37 PM   #21
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,243
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by rjwse@aol.com View Post
That settles it. then. The world-renouned Ubyssey newspaper is our standard.
World-renowned? Unlikely. A good place to start learning about typography? At that time and place, it was exactly that. The people who actually printed the newspaper and from whom I learned my starting lessons about typography from had decades of experience and, luckily for me, were more than willing to share that experience with a snot-nosed kid.

Also try to remember that a physical book has the advantage that people are not going to be changing the font, font size, line spacing, margins, etc. on the final product. An ebook? Quite a few people will be doing all of those.
DNSB is offline   Reply With Quote
Old 06-20-2025, 05:26 PM   #22
Falkor
Connoisseur
Falkor began at the beginning.
 
Posts: 89
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
Quote:
Originally Posted by Slevin#7 View Post
May I ask, what is your solution to that? I haven't had any success with that and ended up putting the caption into the image as grafical part of it - not a very pretty solution.
This kinda works for me:
Code:
<figure>
 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"  viewBox="0 0 960 1207" preserveAspectRatio="xMidYMid meet"><image width="960" height="1207" xlink:href="../picture.jpg"/></svg>
  <figcaption>This is a caption</figcaption>
</figure>
Code:
figure {
  text-align: center;
  -webkit-column-break-inside: avoid !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  display:block;
}

figure > svg {
  height:80vh;
  width:100%;
}

figcaption {
  height:18vh;
  }
The trick was to not give the figure a height. That eliminated all kinds of issues.
Falkor is offline   Reply With Quote
Old 06-20-2025, 05:45 PM   #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,758
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 Falkor View Post
Personally, I consider them to be electronic books – so one should be able to style them somewhat like a book.

The "fancy" stuff is usually not that difficult. "Initial-letter" works pretty well and is widely supported – I don't have any reading app that doesn't support it. If it's not supported by a renderer it's not a big deal either. It can simpy be ignored (though I really think this absolutely needs to be supported on modern reading devices. Drop caps and raised caps are widely used and initial-letter is great solution for all the problems everybody is having with them).

Mirrored text (with an svg wrapper) works flawlessly for me as well.

On the other hand I've been trying to keep images and captions together on one page with <figure> and <figcaption>. Sounds very basic, but it's surprisingly challenging. With four different reading applications I can get four different results. They all behave very differently.

Also page breaks: epub is a format for books. The content is almost always displayed as pages. Yet the concept of pages is not even implemented into many readers and they use columns instead–and the two concepts may clash. Setting pagebreaks with CSS should really be quite simple. But the only way to make them work consistently in all reading apps is by splitting up the document.



That's what the "initial-letter" property is for. You set the size and sink and the renderer calculates the actual height and placement depending on the line height and font size.
So how do you do a drop cap for ePub 2? There is no initial letter. I prefer to read on my Kobo with ePub because it renders better. I will read with KePub when there is a need for it. But a drop cap is not a need for KePub.
JSWolf is offline   Reply With Quote
Old 06-20-2025, 05:46 PM   #24
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,758
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 Falkor View Post
This kinda works for me:
Code:
<figure>
 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"  viewBox="0 0 960 1207" preserveAspectRatio="xMidYMid meet"><image width="960" height="1207" xlink:href="../picture.jpg"/></svg>
  <figcaption>This is a caption</figcaption>
</figure>
Code:
figure {
  text-align: center;
  -webkit-column-break-inside: avoid !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  display:block;
}

figure > svg {
  height:80vh;
  width:100%;
}

figcaption {
  height:18vh;
  }
The trick was to not give the figure a height. That eliminated all kinds of issues.
Are your eBooks supposed to be backwards compatible? Because if so, your code won't work. If not, then your code is OK.
JSWolf is offline   Reply With Quote
Old 06-20-2025, 08:25 PM   #25
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,243
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
So how do you do a drop cap for ePub 2? There is no initial letter. I prefer to read on my Kobo with ePub because it renders better. I will read with KePub when there is a need for it. But a drop cap is not a need for KePub.
The same way it's been done for decades. You wrap the first letter of the first paragraph in a chapter with a span. It may not be pretty but it's works until you change the view settings too far. From one recent ePub book:

Code:
<p class="first first-in-chapter first-full-width first-with-first-letter-m"><span class="first-letter first-letter-m first-letter-without-punctuation">M</span>
And yes, this ebook has 20 first-with-first-letter-? styles for the paragraphs and 20 first-letter-? styles for each of the spans.
DNSB is offline   Reply With Quote
Old 06-22-2025, 08:15 AM   #26
Falkor
Connoisseur
Falkor began at the beginning.
 
Posts: 89
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
Quote:
Originally Posted by JSWolf View Post
Are your eBooks supposed to be backwards compatible? Because if so, your code won't work. If not, then your code is OK.
Right, for backwards compatibility one would at least have to offer alternatives for all the heights in vh.

Quote:
Originally Posted by JSWolf View Post
So how do you do a drop cap for ePub 2? There is no initial letter. I prefer to read on my Kobo with ePub because it renders better. I will read with KePub when there is a need for it. But a drop cap is not a need for KePub.
The simplest way would be not to provide any fallback at all because it just doesn't work that well in epub2 (and even epub3 without support for initial-letter). So I'd use
Code:
@supports (initial-letter: 2) {…}
around the entire rule. Technically that's not supported by epub2 either, but as invalid rules must be ignored, it still does the trick.

This will also eliminate problems with renderers that support :first-letter, but not initial letter.

If you must have drop caps in epub2 as well, I guess you could still add spans and style them. Then you'd have to undo the span’s styling for all renderers that support initial-letter.
Falkor is offline   Reply With Quote
Old 06-23-2025, 02:54 PM   #27
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,355
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Falkor View Post
Right, for backwards compatibility one would at least have to offer alternatives for all the heights in vh.



The simplest way would be not to provide any fallback at all because it just doesn't work that well in epub2 (and even epub3 without support for initial-letter). So I'd use
Code:
@supports (initial-letter: 2) {…}
around the entire rule. Technically that's not supported by epub2 either, but as invalid rules must be ignored, it still does the trick.

This will also eliminate problems with renderers that support :first-letter, but not initial letter.

If you must have drop caps in epub2 as well, I guess you could still add spans and style them. Then you'd have to undo the span’s styling for all renderers that support initial-letter.
Doesn't the @supports include an if/then/else format?? That gives you the css to set if it doesn't support the selector.
Turtle91 is offline   Reply With Quote
Old 06-23-2025, 03:56 PM   #28
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,758
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 Falkor View Post
Right, for backwards compatibility one would at least have to offer alternatives for all the heights in vh.
The problem is that when you vh or % (ie, margin, height, etc) whichever is second in the CSS is what's used. So if the reading software doesn't do vh, and that's second, it won't do anything. Neither will do anything.



Quote:
The simplest way would be not to provide any fallback at all because it just doesn't work that well in epub2 (and even epub3 without support for initial-letter). So I'd use
Code:
@supports (initial-letter: 2) {…}
around the entire rule. Technically that's not supported by epub2 either, but as invalid rules must be ignored, it still does the trick.

This will also eliminate problems with renderers that support :first-letter, but not initial letter.

If you must have drop caps in epub2 as well, I guess you could still add spans and style them. Then you'd have to undo the span’s styling for all renderers that support initial-letter.
You have to be careful. If ADE 2.0.1 or 3.x thinks your code is a mistake, the entire CSS will be ignored.

What would happen if you had first-letter and a span for a program that supports both? This is a good reason to forgo drop caps if you need ePub2 compatibility.
JSWolf is offline   Reply With Quote
Old 06-23-2025, 04:00 PM   #29
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,758
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 Turtle91 View Post
Doesn't the @supports include an if/then/else format?? That gives you the css to set if it doesn't support the selector.
That's a very good suggestion.
JSWolf is offline   Reply With Quote
Old 06-23-2025, 04:31 PM   #30
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,048
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
K I S S

Which is more important? Everyone being able to read it easily on anything, or being stubborn about a display feature?

If it's for personal use you can be as clever as you like. Sometimes for mass publication being clever is dumb.
Quoth is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Epub vs Standard Epub JudahsShadow Library Management 3 05-01-2023 01:55 PM
Linux ePub reader app that best fullfills the ePUB standard celiapgt Reading and Management 12 04-19-2022 12:42 AM
Help revise the Epub standard Nate the great General Discussions 8 04-18-2010 11:29 AM
Standard Reader for Epub bhuvana786 ePub 6 08-21-2009 11:00 AM


All times are GMT -4. The time now is 11:19 AM.


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