Skip to content

:lang(lzh) elements in non-traditional-Chinese CJK elements should not switch font to Traditional Chinese one #13050

@tats-u

Description

@tats-u

An old Chinese literal text (known as Kanbun in Japan) is occasionally quoted in non-Chinese region. However, a Taiwanese or Hong Kongese font is always used if you specify lang=lzh:

<div lang=ja>
  <blockquote lang=lzh>子曰、後生可畏、焉知来者之不如今也</blockquote>

  <p lang=ojp-t-lzh>子曰く、<ruby>後生<rp></rp><rt>こうせい</rt><rp></rp></ruby><ruby><rp></rp><rt>おそ</rt><rp></rp></ruby>るべし。いずくんぞ<ruby>来者<rp></rp><rt>らいしゃ</rt><rp></rp></ruby>の今にしかざるを知らんや</p>

  <p lang=ja-t-lzh>年が若いとは、将来に希望があることだ。今後の世代が、現在の世代を乗り越えていかないとはいえないのだ。</p>
  
  <blockquote lang=lzh>子曰、道聴而塗説、徳之棄也</blockquote>

  <p lang=ojp-t-lzh>子曰く、道に聴きて<ruby><rp></rp><rt>みち</rt><rp></rp></ruby>に説くは、徳これ棄つるなり</p>

  <p lang=ja-t-lzh>
聞きかじったことを右から左へ受け売りして得意がる。これでは徳は身につかない。</p>
</div>

https://codepen.io/tats-u/pen/MYKPoXa

Image

A text marked as lzh is not concerned with modern Chinese font specifications today. It should be respect the language of ancestor elements whose language is CJK.

  • Expected: rendered using a Japanese font (if ancestor elements are ja)
  • Actual: rendered using a Taiwanese or Hong Kongese (traditional Chinese) font
  1. If the element's language is lzh,
  2. Find a nearest ancestor whose language is CJK
  3. If find one, inherit its font preset of its language
  4. If no one (e.g. when the page is written in English), use the font preset of traditional Chinese

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions