Closed elmagio closed 10 months ago
It's indeed by design, and that's why it's called "Default Font", i.e. the default if the book doesn't specify any. But it does need an option to override publisher fonts.
As a workaround, you can add the following to user-stylesheet.css
:
* {
font-family: inherit !important;
line-height: inherit !important;
}
Thanks for the workaround !
It just occurred to me that using inherit
will break elements like pre
, code
, samp
, etc. So one should probably use revert
instead.
* {
font-family: revert !important;
}
Thank you for this workaround, however, applying it to a book with code blocks that are ordinarily rendered in a monospaced font makes those blocks also render with the default font, even when I've specified a monospaced font in Foliate's preferences.
revert
works for code blocks, which is usually marked up with <pre>
, which is styled by the user agent (i.e. WebKit) with the default monospace font.
You can use the inspector (F12) to see what's happening.
Describe the bug When a EPUB book has specific fonts designated by a style.css or similar file, Foliate 3.0 will not apply user chosen default fonts. I'm marking this as a bug as Foliate 2.6.4 used to automatically apply the user chosen font to all books regardless of style sheets, however if this is the desired behavior this can serve as a feature request for an optional "Force user fonts" setting. MOBI files made by converting the problematic EPUBs in Calibre do not exhibit the issue.
To Reproduce Steps to reproduce the behavior:
Expected behavior The selected font or font category (Serif/Sans-serif) should be applied
Version:
Additional context I had to zip up an example epub to share it, as Github would not let me upload an .epub file as is: Example.zip