Git Product home page Git Product logo

Comments (1)

 avatar commented on May 27, 2024

We fixed this issue (cANDI 3.2.2). Here is some additional info for future reference:

cANDI is certainly taking font size and weight into consideration. WCAG’s current requirement for large text, 14pt bold, is not exactly precise. Using the point (pt) unit is relevant to the font chosen and the user agent (OS/browser) doing the conversion into pixels. See this definition of large scale text from WCAG (especially note 3) http://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html#larger-scaledef. Therefore, all font size units (pt, em, %, etc.) are converted to px to perform the comparison.

A google search for “pt to px conversion”, returns only approximate figures. Some results show 14pt to be approximately 19px. Some calculators put it closer to 18.5px. Using Windows 10 both IE and Chrome are calculating 14pt to be 18 pixels (they may be rounding down). Since cANDI relies on the user agent to provide the computed unit (the pixel value), its cut-off was at 18.5pixels, which is why this github issue was created.

To resolve this issue, we adjusted the large text threshold to be 18px so that when testing against basic fonts on Windows 10 IE/Chrome/Firefox, the 3:1 ratio check will kick in. Keep in mind some user agents/fonts may convert 14pt to a different pixel value, which may show this type of issue again.

The underlying issue is with how WCAG defines large text. If it was defined using pixels instead of points, there would be no room for such discrepancies.

from andi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.