This exploratory test checks whether user agents will select different fonts for display of ideographic text when language attribute values vary in the markup.
Some browsers apply the fonts listed in the user font preferences to the display of HTML Unicode text in Traditional Chinese, Simplified Chinese, Japanese and Korean, depending on the setting of the lang/xml:lang attribute. Note that this is not specified in the HTML specification, and, of course, doesn't apply where explicit styling is applied.
See the results below for user agents tested. This section summarizes the results of those tests.
Only IE and Firefox apply different fonts based on the language.
Safari doesn't even provide a means to associate default fonts by language. Chrome offers associations for only a few scripts, which don't include ideographic characters. Although Opera allows you to assign different fonts for the same Han characters while distinguishing between Simplified and Traditional forms, fonts can only be assigned to hangul characters for Korean, and kanji for Japanese. Although Opera allows you to set different default fonts for different ideographic sets, it no longer seems to use that information in practice.
The default Han font (ie. with no language information) for Firefox Japanese. For IE7 it is Simplified Chinese. For Opera it is that set for Traditional Chinese.
Of the UAs that substitute fonts, all handle zh-Hans and zh-Hant as you would expect.
Firefox allows you to set a different setting for Traditional Chinese in Taiwan and Hong Kong. It uses the same font for zh-Hans and zh-TW. It uses the Hong Kong font setting for zh-HK only.
The results of this test were different in older versions of the browsers tested.
These are results for the latest versions of each user agent tested. A green background (yes) means that the assertion associated with the test held true; red (no) means that it did not; orange (partially) means that it was only partially true.
In the lower part of the table, column titles indicate the language attribute declared for a paragraph containing Han text. The results show which font was applied. JA = Japanese, SC = Simplified Chinese, TC = Traditional Chinese, HK = Hong Kong, KO = Korean, X = a totally different font.
|CJK text||yes||yes||yes||no 1||no 2||no 2|
Tell us what you think (English).
Content first published 2009-04-16. Last substantive update 2009-04-16 9:23 GMT. This version 2009-04-16 9:23 GMT
For the history of document changes, search for results-lang-and-cjk-font in the i18n blog.
Copyright © 2007-2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.