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

Clarified and included CJK requirements in large text definition and updated rules affected by this change #2121

Merged
merged 48 commits into from
Apr 25, 2024

Conversation

giacomo-petri
Copy link
Collaborator

@giacomo-petri giacomo-petri commented Sep 15, 2023

Since the WCAG is not unambiguously defining what "equivalent size for Chinese, Japanese and Korean (CJK) fonts" means, I've added the definition of large text for CJK languages, based on the Japanese translation of WCAG 2.1 with the assumption that it applies also to the other CJK languages.

Edits:

  • updated the large text definition;
  • updated ACT contrast minimum examples to reflect updates;
  • updated ACT contrast enhanced examples to reflect updates.

Closes #2068

Need for Call for Review:
This will require a 2 weeks Call for Review


Pull Request Etiquette

When creating PR:

  • Make sure you're requesting to pull a branch (right side) to the develop branch (left side).
  • Make sure you do not remove the "How to Review and Approve" section in your pull request description

After creating PR:

  • Add yourself (and co-authors) as "Assignees" for PR.
  • Add label to indicate if it's a Rule, Definition or Chore.
  • Link the PR to any issue it solves. This will be done automatically by referencing the issue at the top of this comment in the indicated place.
  • Optionally request feedback from anyone in particular by assigning them as "Reviewers".

When merging a PR:

  • Close any issue that the PR resolves. This will happen automatically upon merging if the PR was correctly linked to the issue, e.g. by referencing the issue at the top of this comment.

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote a few things, including updating the links as I found this a little difficult to read with all the URLs in them:

**Exception**: If the text nodes contain Unicode characters in the 4E00–9FFF range:

- at least 22 [points][], or
- at least 18 [points][] and a [computed][] [font weight][] CSS property of 700 or higher.

**Notes:**  
The WCAG definition of [large scale text](https://www.w3.org/TR/WCAG21/#dfn-large-scale) includes an exception for CJK (Chinese, Japanese, and Korean) text. The Unicode range 4E00–9FFF includes these characters. The "equivalent size" numbers are not included in WCAG, and come from the [Official Japanese Translation of WCAG 2.1](https://waic.jp/translations/WCAG21/#dfn-large-scale).  This translation offers the following insight (translated from Japanese to English to allow everyone understanding the specs):  

> TRANSLATION NOTE  
> In the case of Japanese full-width characters, 22 point or 18 point bold type is considered to be the "equivalent" size, based on the First Report of the Enlarged Textbook Promotion Council, "Chapter 2 Standards for Enlarged Textbooks." is reasonable."
Assuming all CJK characters pose similar contrast challanges, this definition extends the Japanese requirement to the whole CJK characters set included in the [Unicode standard](https://unicode.org/charts/PDF/U4E00.pdf) within the range of 4E00–9FFF.

[computed]: https://www.w3.org/TR/css-cascade-3/#computed-value
[font-size]: https://www.w3.org/TR/css-fonts-3/#propdef-font-size
[points]: https://www.w3.org/TR/css-values/#pt
[font weight]: https://www.w3.org/TR/css-fonts-3/#font-weight-prop

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taiwan has different requirements than Japan, I propose the following:

**Exception**:  
A text node containing Unicode characters in the 4E00–9FFF range ([CJK Unified Ideographs](https://unicode.org/charts/PDF/U4E00.pdf)) is <dfn id="large-scale-text:cjk">large scale text</dfn> if at least one of the following is true:

- the Japanese text node [computed][] [font-size][] is at least 22 [points][], or
- the Traditional Chinese text node [computed][] [font-size][] is at least 20 [points][], or
- the Japanese text node [computed][] [font-size][] is at least 18 [points][] and has a [computed][] [font weight][] of 700 or higher, or
- the Traditional Chinese text node [computed][] [font-size][] is at least 16 [points][] and has a [computed][] [font weight][] of 700 or higher.

**Notes:**  
The WCAG definition of [large scale text](https://www.w3.org/TR/WCAG21/#dfn-large-scale) includes an exception for CJK (Chinese, Japanese, and Korean) fonts. The Unicode range 4E00–9FFF includes these characters. The "equivalent size" numbers are not included in WCAG, and come from the [Taiwanese Readability Reference Guidelines](https://crpd.sfaa.gov.tw/BulletinCtrl?func=downloadFile&type=file&id=3749&code=F9FEF1F8F1FAF6FAFCFAFCFCFFFAF2F3) (PDF download) and the [Unofficial Japanese Translation of WCAG 2.1](https://waic.jp/translations/WCAG21/#dfn-large-scale). The Taiwanese Readability Reference Guidelines requires minimal font size 16 points for Traditional Chinese characters and 14 points for English characters to be fulfill the need of the people with disabilities, and the Unofficial Japanese translation offers the following insight (translated from Japanese to English to allow everyone understanding the specs):

Copy link
Member

@carlosapaduarte carlosapaduarte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some editorial suggestions for the definition

>TRANSLATION NOTE
>In the case of Japanese full-width characters, 22 point or 18 point bold type is considered to be the "equivalent" size, based on the First Report of the Enlarged Textbook Promotion Council, "Chapter 2 Standards for Enlarged Textbooks." is reasonable."

Assuming all CJK characters pose similar contrast challanges, this definition extends the Japanese requirement to the whole CJK characters set included in the [Unicode standard](https://unicode.org/charts/PDF/U4E00.pdf) within the range of 4E00–9FFF.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to indicate that that Unicode range describes the CJK Unified Ideographs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added at the beginning of the Exception for a better understanding

@@ -12,3 +12,18 @@ Text nodes with a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value

- at least 18 [points](https://www.w3.org/TR/css-values/#pt), or
- at least 14 [points](https://www.w3.org/TR/css-values/#pt) and a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font weight](https://www.w3.org/TR/css-fonts-3/#font-weight-prop) CSS property of 700 or higher.

For CJK (Chinese, Japanese and Korean) characters with a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font-size](https://www.w3.org/TR/css-fonts-3/#propdef-font-size) of:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For CJK (Chinese, Japanese and Korean) characters with a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font-size](https://www.w3.org/TR/css-fonts-3/#propdef-font-size) of:
For CJK (Chinese, Japanese and Korean) characters within text nodes, a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font-size](https://www.w3.org/TR/css-fonts-3/#propdef-font-size) of:

Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done.

I think we should vary the languages in the new examples and have some in Korean or Chinese (OK, Chinese will be the same character set…)

_rules/text-contrast-afw4f7.md Outdated Show resolved Hide resolved
_rules/text-contrast-enhanced-09o5cg.md Outdated Show resolved Hide resolved
- at least 18 [points][] and a [computed][] [font weight][] CSS property of 700 or higher.

**Notes:**
The WCAG definition of [large scale text](https://www.w3.org/TR/WCAG21/#dfn-large-scale) includes an exception for CJK (Chinese, Japanese, and Korean) fonts. The Unicode range 4E00–9FFF includes these characters. The "equivalent size" numbers are not included in WCAG, and come from the [Official Japanese Translation of WCAG 2.1](https://waic.jp/translations/WCAG21/#dfn-large-scale). This translation offers the following insight (translated from Japanese to English to allow everyone understanding the specs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that an unofficial translation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed it while accepting Wilco suggestion. Good catch.
Updated

Comment on lines 11 to 21
Text nodes with a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font-size][] of:

- at least 18 [points](https://www.w3.org/TR/css-values/#pt), or
- at least 14 [points](https://www.w3.org/TR/css-values/#pt) and a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font weight](https://www.w3.org/TR/css-fonts-3/#font-weight-prop) CSS property of 700 or higher.
- at least 14 [points](https://www.w3.org/TR/css-values/#pt) and a [computed](https://www.w3.org/TR/css-cascade-3/#computed-value) [font weight][] CSS property of 700 or higher.


**Exception**:
If the text nodes contain Unicode characters in the 4E00–9FFF range ([CJK Unified Ideographs](https://unicode.org/charts/PDF/U4E00.pdf)), these characters are:

- at least 22 [points][], or
- at least 18 [points][] and a [computed][] [font weight][] CSS property of 700 or higher.
Copy link
Collaborator

@Jym77 Jym77 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think we should rephrase the full definition (as it doesn't look like correct English now), in the line of:

A text node is large scale text if its [computed][] [font-size][] is:

  • at least 18 [points[]; or
  • at least 14 [points][] and its [computed][] [font+weight][] is at least 700.

Exception:
A text node containing CJK characters is large scale text if …

Maybe even start the definition with "depending whether the text node contains CJK characters, …" 🤔

Also, if the defined term instances (_large scale text_) are wrapped in a dfn element, we can reference them directly from the running text:

<dfn id="large-scale-text:cjk">large scale text</dfn>
This is [large scale text][#large-scale-text:cjk]

See, e.g. attribute value in image button name rule

Additionally (but not directly related to this PR, so may be taken separately):

  • These lists do not match how we write condition lists now; should be "if at least one of the following is true: the [computed][] [font-size][] is at least 18 points; or…"
  • Technically, text nodes do not have CSS properties, only their parent element has, so the language used here is a bit incorrect (although not really confusing…)
  • Also, not need to say "[font weight][] CSS propert" when the name already links to CSS specs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions applied rewriting the definition and starting with "A text node..."


Additionally (but not directly related to this PR, so may be taken separately):

These lists do not match how we write condition lists now; should be "if at least one of the following is true: the [computed][] [font-size][] is at least 18 points; or…"

Happy to edit condition lists and include them in the current edits.

Technically, text nodes do not have CSS properties, only their parent element has, so the language used here is a bit incorrect (although not really confusing…)

You're absolutely right. This was the case in the previous iteration as well. I'm struggling to find a straightforward method to enhance its clarity without adding more complexity to the definition.

Also, not need to say "[font weight][] CSS propert" when the name already links to CSS specs.

updated.

@giacomo-petri giacomo-petri dismissed stale reviews from colabottles, carlosapaduarte, Jym77, and WilcoFiers February 7, 2024 10:42

requirements changed based on ACT meeting

@giacomo-petri giacomo-petri self-assigned this Feb 9, 2024
Jym77
Jym77 previously requested changes Feb 15, 2024
Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I believe we also need to have the note about CJK (or part of it) directly in the rules, in the lines of:

    For CJK characters used in some languages and countries, a font size of 18-22pt should not be consider "large text". These may fail the SC while still passing the rule.

  • We can keep some CJK examples, to show we've considered them.

__tests__/spelling-ignore.yml Outdated Show resolved Hide resolved
pages/glossary/large-scale-text.md Outdated Show resolved Hide resolved
pages/glossary/large-scale-text.md Outdated Show resolved Hide resolved
@giacomo-petri giacomo-petri requested a review from Jym77 March 4, 2024 08:49
pages/glossary/large-scale-text.md Outdated Show resolved Hide resolved
@giacomo-petri
Copy link
Collaborator Author

giacomo-petri commented Apr 8, 2024

Call for review ends on April 16th April 23rd (2 weeks).

@giacomo-petri giacomo-petri added Review call 2 weeks Call for review for new rules and big changes and removed reviewers wanted labels Apr 8, 2024
@Jym77
Copy link
Collaborator

Jym77 commented Apr 25, 2024

Call for review has ended, merging.

@Jym77 Jym77 merged commit 24a9bcd into act-rules:develop Apr 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review call 2 weeks Call for review for new rules and big changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contrast rules should account for CJK text size [afw4f7] [09o5cg]
10 participants