Comments (2)
This happens only when a book has styles on elements other than the <body>
, which is where the font overrides are set. In this case the book for some reason wraps all its contents in a <div>
and sets font-family
to serif
, which is why it's being displayed with the default serif font.
I think this can be fixed by setting the default serif and sans-serif fonts in WebKit. This might break things, however, if, in some cases, the serif/sans-serif distinction is needed. A way to solve this would be to offer the user the option to set serif and sans-serif separately (and probably monospace, too).
That would only fix the font family, however. I'm not sure if we should also force styling using the universal selector. That might fix issues with books that hardcodes styles for no good reason, but there are cases where this would break the book's intended styling.
I think a good compromise would be:
-
Set both default serif and sans-serif font in WebKit to the user selected font
-
Force line-height with the
*
selector
There's rarely any good reason for books to hardcode that, as far as I can see. But other properties should be left untouched
Edit: should probably force font-size as well. If we only set these onp
, it shouldn't break too many things. -
Offer a "use default stlying" option to disable all custom styles
from foliate.
This and similar cases should be fixed now. I'm a bit uneasy about using !important
as this already breaks one of the books that I tested that for some reason uses p
with big font-size for titles.
On balance I think this is a good compromise. 395b0b2 should fix most problems with custom styles not working.
As for a "use publisher default" setting, I'm not quite sure how that can be achieved at the moment. If anyone is interested in that or has any other styling problems, feel free to open a new issue.
from foliate.
Related Issues (20)
- syntax highlighting of code blocks only works for default theme HOT 7
- Offset value for pagination HOT 5
- Is it possible to remove the border? HOT 3
- Option to watch folders
- Possible to downgrade GTK dependency? HOT 2
- Improved search navigation suggestions HOT 3
- Equation render problem HOT 5
- Icons not rendering properly in some parts of the application HOT 2
- User stylesheet not working HOT 2
- Building from source fails HOT 3
- How to change highlight color? (plase refer to the screenshot) HOT 2
- Foliate should not separate quotation marks from text across line breaks when rendering EPUB files HOT 7
- High Contrast Dark Mode
- Line Height and Justification do not apply to some books HOT 1
- Is there any way to configure TTS in Foliate 3.1.1? HOT 1
- Text doesn't show. HOT 1
- Improve SVG viewer
- Any chance for an AppImage version ? HOT 1
- Option to open PDFs in external app
- Resizing one foliate instance would causes the other foliate instance will also resize HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foliate.