0

Why does the lang attribute effect rendering? For example, the following html renders like this on my computer

<html>
<p lang="zh">lang=zh: 才 Aa</p>
<p lang="zh-tw">lang=zh-tw: 才 Aa</p>
<p lang="ja">lang=ja: 才 Aa</p>
</html>

screenshot

But if I explicitly specify a Chinese or Japanese only font-family, then they will look identical.

Does this mean my system/browser default font family contains multiple glyph for the same character, or does the browser select different font for each language?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
yyyy
  • 593
  • 2
  • 10
  • there's a similar question but get downvoted and has no answer. https://stackoverflow.com/questions/74730807/html-lang-attribute-changes-font-completely – yyyy Dec 31 '22 at 19:00
  • "Why does the `lang` attribute effect rendering?" Because you're telling the browser the language of a particular element is different. – Heretic Monkey Dec 31 '22 at 19:00
  • You can view what font the browser is using to render an element by right-clicking the element, selecting Inspect, then going to the Computed pane on the right-hand side. It should have a Rendered Fonts section at the bottom. – Heretic Monkey Dec 31 '22 at 19:03

1 Answers1

0

Oh it's a browser feature. I found the related settings.

enter image description here

yyyy
  • 593
  • 2
  • 10