w3c / w3c/clreq

The glyphs of punctuation marks do not match the requirements for Chinese text layout

Open
#430 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

doc:clreq gap i:fonts l:zh p:advanced s:hani
Dominant language
HTML
Stars
809
Forks
66
Avg merge
19m
Merged PRs (30d)
1

Description

This issue applies to Chinese.

The glyphs in some system fonts do not match the requirements for Chinese text layout.

Below are the problematic code points.

  • `U+2E3A TWO-EM DASH[⸺]`: it should be vertically centred. It does not exist in PingFang SC/TC, Microsoft JhengHei, and Microsoft YaHei.
  • `U+2014 EM DASH [—]`: it should be vertically centred. It is not vertically centred in Microsoft JhengHei and Microsoft YaHei.
  • `U+2026 HORIZONTAL ELLIPSIS`: it should be vertically centred. It is not vertically centred in PingFang SC/TC, Microsoft JhengHei, and Microsoft YaHei.
  • `U+2013 EN DASH [–]` should be vertically centred. It is not vertically centred in Noto Sans TC/SC, Microsoft JhengHei, and Microsoft YaHei.
  • `U+00B7 MIDDLE DOT [·]`: it should have the same width or half the width of a Han character. It does not in PingFang SC/TC, Noto Sans TC/SC, Microsoft JhengHei, and Microsoft YaHei.

Font developers should utilize the OpenType locl GSUB feature. When a layout engine flags the text as Chinese, the font must substitute the default Latin-aligned glyph with their vertically centered, full-width counterparts.

And the root cause of this problem is that some Chinese and Western punctuations share the same code points. See also requirements in clreq.

Tests & results:
Interactive test The glyphs of punctuation marks will match the requirements for Chinese text layout.

  • PingFang SC: U+2E3A ❌ U+2014 ✅ U+2026 ❌ U+2013 ❌
  • PingFang TC: U+2E3A ❌ U+2014 ✅ U+2026 ❌ U+2013 ❌
  • Microsoft JhengHei: U+2E3A ❌ U+2014 ❌ U+2026 ❌ U+2013 ❌
  • Microsoft YaHei: U+2E3A ❌ U+2014 ❌ U+2026 ❌ U+2013 ❌
  • Noto Sans TC: U+2E3A ✅ U+2014 ✅ U+2026 ✅ U+2013 ❌
  • Noto Sans SC: U+2E3A ✅ U+2014 ✅ U+2026 ✅ U+2013 ❌

Priority:
Given that a workaround is possible (i.e., changing the font), this is prioritised as an advanced issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the inline-layout requirements in the linked clreq section and compare them with the punctuation cases in the issue. Run the linked interactive glyph-character test to verify the listed code points and fonts. Done means the Chinese-layout requirements and expected results are resolved or documented for the affected glyphs.

Written by the indexing model from the issue text.

Assessment

Domain
internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.