johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.42k stars 295 forks source link

Line Height and Justification do not apply to some books #1332

Open kaptem opened 5 months ago

kaptem commented 5 months ago

Describe the bug The foliate settings for line height and justification do not apply to some booys.

Expected behavior For the Foliate settings to always apply or for a toggle to force the Foliate settings for line height and justification onto a book. Version:

johnfactotum commented 5 months ago

Currently you can already force any style you'd like using the user stylesheet.

What remains is whether to force things by default and how to make it optional. It would be possible to add these option in the settings, but then there's the question of whether to present them as separate options, or to bundle them together in a single "override publisher style" sort of option.

Always forcing justification by default is absolutely out of the question. In my opinion it breaks too many things to even be an optional setting.

Forcing line-height by default might be tolerable. It's perhaps okay and in fact somewhat necessary when forcing the font. The problem here is how exactly to force it. Maybe just use !important for p, li and dd, but that might not be enough for some books. (Not sure about blockquote even though currently it does set it [without !important but ordered at the end of non-inline styles]. Perhaps only apply it to blockquotes containing only phrasing content, like blockquote:not(:has(p, h1, h2, h3, h4, h5, h6, header, hgroup, section, article, aside, div)) but that seems a bit heavy.)

So here's one tentative solution:

Some alternatives: