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

Font not applying on the header Title of book. #147

Closed
Aslanyan99n opened this issue Jun 13, 2024 · 2 comments
Closed

Font not applying on the header Title of book. #147

Aslanyan99n opened this issue Jun 13, 2024 · 2 comments

Comments

@Aslanyan99n
Copy link

I'm submitting a bug.
Font not applying on the header Title of book.
I am using swift-toolkit for supporting epub books.
When I setting font for book it not applying font for headers, it only work for text content.
I expected set correct font for each of text.

  • Platform: iOS
  • Browser / Rendering Engine: iOS WKWebView
Screenshot 2024-06-13 at 09 48 46 Screenshot 2024-06-13 at 09 49 00
@JayPanoz
Copy link
Collaborator

Hi,

We’re currently reworking ReadiumCSS into an unopinionated library so this feedback is very useful. Thank you.

Currently, headings are not targeted when changing the font in user settings:

:root:--font-override[style*="--USER__fontFamily"] body,
:root:--font-override[style*="--USER__fontFamily"] p,
:root:--font-override[style*="--USER__fontFamily"] li,
:root:--font-override[style*="--USER__fontFamily"] div,
:root:--font-override[style*="--USER__fontFamily"] dt,
:root:--font-override[style*="--USER__fontFamily"] dd {
font-family: inherit !important;
}

However, it’s handled differently for the “Accessible fonts”:

/* Targeting everything except code. Note that Open Dyslexic has a monospaced font for code */
:root:--font-override:--a11y-font *:not(code):not(var):not(kbd):not(samp),
:root:--font-override:--a11y-normalize *:not(code):not(var):not(kbd):not(samp) {
font-family: inherit !important;
font-weight: inherit !important;
font-style: inherit !important;
}

Which smells like making an artificial distinction, since a user could use a non-accessibility-specific font for accessibility reasons.

There’s an accessibility normalisation flag available in that case, but it’s pretty global since it will also remove bolding, italicising, etc.

Originally, one goal was to find a balance between Reading System/apps’ overrides and authoring – in typography and book design fonts can carry a lot of meaning, and overriding may not be the ideal solution in some cases as meaning will be lost. So it’s not uncommon apps decide not to override the font for headings as a consequence.

That being said, there’s no way to guarantee we’re not losing meaning in body copy or divs, or lists, etc. And well, if you want to enjoy the original design, you can always switch back to publishers’ fonts.

So it’s a default we will have to discuss in the redesign process.

@Aslanyan99n
Copy link
Author

Aslanyan99n commented Jun 25, 2024 via email

JayPanoz added a commit that referenced this issue Aug 1, 2024
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