daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
76 stars 22 forks source link

Font size in pixels #312

Open laudrain opened 4 years ago

laudrain commented 4 years ago

Please provide the following details if possible or relevant:

Do Ace reports font sizing in pixels ? This has an impact on displayTransformability and then to accessibility.

clapierre commented 4 years ago

That would be good to flag that, thanks for bringing this up and also maybe the inspection of !important on a font size in CSS.

danielweck commented 4 years ago

Hello, I am trying to understand the feature request.

When analysing a rendered DOM, it is indeed possible to obtain the "font size" of any HTML element, as reported by the "computed style" API. For example, this is a typical result for the body element:

window.getComputedStyle(window.document.body)["font-size"] => 16px

However, elements further deep into the DOM can override this "base" font size, so can this information really be meaningful / useful, especially in relation to accessibilityFeature and displayTransformability?

Thank you for clarifying :)

laudrain commented 4 years ago

@danielweck I'd say that any font size expressed in pixels in the source CSS brings an issue on transformability, be it on body or any other element. If the font size after computation is a value in pixels, I think it is ok. But if the source size in the EPUB CSS is in pixels, there is no more transformability.

danielweck commented 4 years ago

I see, thank you for clarifying. So the problem to solve is:

Notes: if I am not mistaken, CSS properties other than font-size should also be analysed? For example, specifying box sizes, margins, etc. can also introduce visual scaling inconsistencies, potentially hindering content responsiveness. Thus the displayTransformability suffix / appendix, I suppose (such as /line-height): https://www.w3.org/wiki/WebSchemas/Accessibility#Features_for_transformation

Thank you for helping to bring clarity on this feature.

laudrain commented 4 years ago

To summarise, any CSS property with an absolute source value that would prevent transformability is an issue.

From the displayTransformability list of properties:

Obviously, /font-family, /color, /background-color will not accept pixels values. And I believe existing RS still allow these properties to be changed by the users. IMO nothing to report by Ace here.

nekennedy commented 4 years ago

Many years ago there was an incident where a book was distributed with all the font-sizes in pixels, and most of the major reading systems did not resize the font when the user changed their settings. There were quite a few mainstream articles about it (like this one from the BBC). While it was 8 years ago, I'm not sure if all the reading systems have updated to account for this.

Unsure if ACE should be reporting these, but I don't think we can assume that RS deal with pixel font-sizes in an accessible way.