I've come across a very annoying design choice in FBReader. Since people have been complaining about it for over a decade, I'm sure it is a choice and not a bug. When FBReader encounters the <hr /> element in an EPUB, it ignores it entirely. Since this is a very common, and I would argue very correct, way to show a break a bit more than a new paragraph and a bit less than a new chapter, this seems like a bad design choice. However, apparently they're not even the only ones.
You could try to fix it by using some <p> </p> instead. This is another common way that ebook creators have used to show section breaks. It mimics the printer solution where everything is formatting and nothing is meaning. However, meaning is now possible and even considered desirable. Also, some ebook readers like to ignore this one as empty space, too. The fact that is explicitly not meant to be treated as empty space is beside the point, apparently. I found one quoted as saying you should be applying larger margins before or after the paragraph, not imposing an empty line. I can only say, no, both are wrong. It's certainly not an improvement.
Back to the problem of FBReader ignoring <hr /> outright: This problem is particularly illustrated by Standard Ebooks, who have thought long and hard about having meaningful markup and concluded also that <hr /> is the right way. They also have made it so the first paragraph in any section does not have an indent although every other one does. So, when there's a paragraph that manages to finish very near the right edge and then a break and then a paragraph without an indent, there isn't even a clue that there's a new paragraph where there's probably been a complete change in all sorts of things like location and viewpoint and on and on. Authors have used these extensively for such things, after all.
It creates a "WTF just happened?" situation as what looks like a continuous paragraph is actually a big change.
But in this is also the seed of a solution. The reader is listening to something to make those paragraphs have no indent. I looked at the code and they aren't specially marked up. I looked at the CSS files and those had a long list of "$thing + p" that would get no indent. One of those is "hr + p".
I tried this little bit of code:
hr + p{
margin-top: 2em;
}
This probably goes in the "core.css" file in a Standard Ebook offering. It'll go in some CSS file in others. The size may be chosen differently, if one desires.
And it works! Well, it can't be styled the way an <hr /> element can, but it captures the look of most printer breaks. Admittedly, they add *** to breaks that occur at the start or end of a page because they are otherwise invisible and you can't here. Hopefully they're not quite so invisible.
Other solutions I have seen is to use (for the asterisk form):
<div class="break">***</div>
And then add some CSS code:
.break{
margin: 1em 0;
text-align: center;
}
Which still has its detractors since one won't align the text as desired. But it does sort of say what it is. Not just a "I feel like a bit of white space should go here for looks" but a meaningful break because something is changing.
Anyway, I'll be adding the "hr + p" one into the CSS to get it working. It'll look a bit stupid if they ever see sense and implement the element, but those WTF moments are worse and this fixes it now.
Comments
Post a Comment