Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow font size adjustment when using publisher fonts #34

Closed
HaasJona opened this issue Jun 3, 2019 · 4 comments
Closed

Allow font size adjustment when using publisher fonts #34

HaasJona opened this issue Jun 3, 2019 · 4 comments

Comments

@HaasJona
Copy link

HaasJona commented Jun 3, 2019

Allowing to use the the publisher fonts works fine since #15, but that also causes the font size to be whatever the publisher chose.

My suggestion would be something like this:

Rename the option to "force custom font" or something along those lines.

  • If "force custom font" is enabled, do pretty much the same as it does currently if a custom font is set.
  • If "force custom font" is disabled, apply font-family and font-size to body (or maybe html?), but without !important, so the book may override it while still being able to provide a font and size for books that don't specify them.
@johnfactotum
Copy link
Owner

johnfactotum commented Jun 3, 2019

Hmm, I think you've raised a very good point. I think I would rather like to keep the option labeled as "use publisher font" (there's no real semantic difference here; "use pub. font" == "don't force", and "force" == "don't use pub. font"), or "use publisher font if available", for clarity.

I think the behavior should be:

  • Mode 1: if "use publisher font" is on, set font-family only on body
  • Mode 2: if "use publisher font" is off, set font-family on everything
  • Everything else, including font-size, line-height, colors, is forced, in both modes

The thing I'm unsure about is whether or not to unset serif_font_family and sans_serif_font_family in WebKit in Mode 1. Some books only specify either "serif" or "sans" for the whole book. More rarely, they need both. If those are unset, it would break the former situation (this is the current behavior); if not, the latter.

@HaasJona
Copy link
Author

HaasJona commented Jun 3, 2019

Everything else, including font-size, line-height, colors, is forced, in both modes

on what? I hope headers and so on can still use different font-size, line-size and so on than the one the user sets. Especially if the epub author specifies something like h1 {font-size: 2em} or h1 {font-size: 200%}.

I think font-size, colors and so on always should be allied only to the body.

Also it would be interesting to see what calibre and so on do to apply the styles. I believe it works well in most of the cases.

@johnfactotum
Copy link
Owner

johnfactotum commented Jun 3, 2019

By "forced" I mean the current behavior when 'use publisher font' is disabled, to wit, size/weight/line-height on both body and p, plus color and background only on body. Edit: font-weight should not be set in Mode 1, as it goes hand-in-hand with font-family.

Also by "set font-family on everything" in Mode 2, I don't actually mean everything. I mean body *:not(code):not(pre), which is, again, the current behavior when 'use publisher font' is disabled.

@johnfactotum
Copy link
Owner

Fix commited in 462b788.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants