Opera's Fonts Problem: An Walkthrough
Opera is a great browser, but its default fonts setting sucks for Taiwanese users. Almost every single user in Taiwan I know has to tweak some settings before he/she can really start using Opera. Very few can live with Opera's default.
What's going on here? Well, let me show you.
Something You Have To Keep In Mind
Fonts
Before we starting to take a deeper look into fonts, you have to know what fonts are available in Taiwanese users' computer.
For a Traditional Chinese version of Windows XP, there are quite few default fonts that are capable to render Chinese characters (fully or partially):
- Monospaced 細明體 (a.k.a. MingLiU) and proportional 新細明體 (a.k.a. PMingLiU) are Unicode fonts and commonly used as default Traditional Chinese fonts among all versions of Windows. These fonts support Code Page 950 (Chinese:Traditional chars--Taiwan and Hong Kong).
- Monospaced 標楷體 is an Unicode font and commonly used as default Traditional Chinese font among all versions of Windows. This font supports Code Page 950 (Chinese:Traditional chars--Taiwan and Hong Kong).
- Proportional 微軟正黑體 is an Unicode font and commonly used as default Traditional Chinese font on Windows Vista and Windows 7. Windows XP users can still install this font by themselves, but this font rendered better on Windows Vista and Windows 7 for these two versions of Windows have more advanced technology on fonts driver. This font supports Code Page 950 (Chinese:Traditional chars--Taiwan and Hong Kong).
- Monospaced 宋体 (a.k.a. SimSun) and proportional 新宋体 (a.k.a. NSimSun) are Unicode fonts and commonly used as default Simplified Chinese fonts among all version of Windows. These fonts support Code Page 936 (Chinese:Simplified chars--PRC and Singapore).
- Proportional 黑体 (a.k.a. SimHei) is an Unicode font and commonly used as default Simplified Chinese font among all versions of Windows. This font supports Code Page 936 (Chinese:Simplified chars--PRC and Singapore).
- Proportional 微软雅黑 (a.k.a. Microsoft YaHei) is an Unicode font and commonly used as default Simplified Chinese font on Windows Vista and Windows 7. Windows XP users can still install this font by themselves, but this font rendered better on Windows Vista and Windows 7 for these two versions of Windows have more advanced technology on fonts driver. This font supports Code Page 936 (Chinese:Simplified chars--PRC and Singapore).
- Monospcaed MS Mincho and proportional MS PMincho are Unicode fonts and commonly used as default Japanese fonts among all version of Windows. These fonts support Code Page 932 (JIS/Japan).
- Monospaced MS Gothic and proportional MS PGothic are Unicode fonts and commonly used as default Japanese fonts among all version of Windows. These fonts support Code Page 932 (JIS/Japan).
Testing Environment
Following demostrations are made with a clean installed Traditional Chinese version of Windows XP Pro SP3 with all windows update up to 2010/05/26. The web browsers used are:
- Opera 10.53 build 3374
- Firefox 3.6.3
- Internet Explorer 8.0.6001.18702
All browsers are fresh installed with default settings.
Testing Material (The Strings)
The mainly used testing strings are:
Eng(te)(st)你我他,恋爱,関係
The first three characters "Eng" are latin-1, followed by a pair of double-byte-width brackets "()" with two latin-1 characters "te" inside, followed by a pair of single-byte-width (latin-1) brackets "()" with another two latin-1 characters "st" inside, then followd by three Chinese characters "你我他", a double-byte-width comma ",", another two Chinese characters "恋爱", a single-byte-width (latin-1) comma ",", and finally two Chinese characters "関係".
But wait! It is not that simple. Some Chinese characters are common in many different languages:
- 你我他 and 係 are valid Traditional Chinese, Simplified Chinese, and Japanese Kanji.
- 恋 is valid Simplified Chinese and Japanese Kanji.
- 爱 is valid Simplified Chinese.
- 関 is valid Japanese Kanji.
It is quite common that a Traditional Chinese web page contains characters of all three languages. This is how Taiwanese users write. So it is fair to test with such a string.
Further, almost all testing HTML files are using <html> tag with xml:lang="zh-tw"
attribution to indicate that the main language used in the web page is Traditional Chinese. Some strings are remain neutral, some are specified to use different font-family such as serif and sans-serif, others are specified to use specific font. All font-size set to 36px so that any one can see the difference much easily.
The Browser UI
The first problem is Opera's UI itself. Opera's default Traditional Chinese UI font is not consistent with Traditional Chinese application convension. Let's take a closer look at it:
(IE)
(Firefox)
(Opera)
All other browsers are using 新細明體 as UI font, but Opera does not.
As you can see, Opera uses 宋体 (SimSun) as default Traditional Chinese UI font. In order to "fix" this problem, Taiwanese users have to go to Preference / Advanced / Fonts, and change all UI fonts to 新細明體:
Now it looks normal. Thanks God.
(IE)
(Firefox)
(Opera)
The Web Content
First let's load sample-01-browser.default.html into Opera. In most Windows XP systems it should look like:
and on Windows Vista or Windows 7:
None of them seems to be right. Please note: you have to watch font baseline and serif carefully to distinguish some of the characters.
Learn From Others
Before we can know what's wrong here, first let's watch how IE and Firefox behave.
Internet Explorer
Let's load sample-02-ie.fonts.html into IE:
The red arrow indicates the default rendered result, and the red square indicates where a glyph came from. So you will find out that:
- IE uses serif font as default web font.
- All latin-1 serif characters are actually Times New Roman.
- All latin-1 sans-serif characters are actually Arial.
- All latin-1 preformatted characters are actually Courier New.
- All double-byte-width symbol are actually 新細明體.
- All characters that are valid Traditional Chinese are actually 新細明體.
- All characters that are not valid Traditional Chinese but valid Japanese Kanji are acutally MS PGothic.
- All characters that are not valid Traditional Chinese nor Japanese Kanji, but valid Simplified Chinese, are actually SimSun.
IE does not doing right here. But we are not going to fix IE anyway.
Firefox
Let's load sample-03-firefox.fonts.html into Firefox:
The red arrow indicates the default rendered result, and the red square indicates where a glyph came from. So you will find out that:
- Unlike IE, Firefox uses sans-serif font as default web font.
- All latin-1 serif characters are actually Times New Roman.
- All latin-1 sans-serif characters are actually Arial.
- All double-byte-width symbol are actually 新細明體.
- All Chinese characters are actually 新細明體.
- All preformatted characters are actually 細明體.
As you can see, Firefox is doing better then IE.
Look At Opera
As to Opera, it is much complicated. On Windows XP, loading sample-04-opera.fonts.xp.html into Opera:
The red arrow indicates the default rendered result, and the red square indicates where a glyph came from. So you will find out that:
- Just like IE, Opera uses serif font as default web font.
- All latin-1 serif characters are actually Times New Roman.
- All latin-1 sans-serif characters are actually Arial.
- All serif double-byte-width symbol are actually smoothed MS PMincho.
- All serif characters that are valid Japanese Kanji are actually MS PMincho, and all smoothed except first glyph.
- All serif characters that are not Japanese Kanji but valid Simplified Chinese are actually not-smoothed SimSun.
- All sans-serif double-byte-width symbol are actually smoothed MS PGothic.
- All sans-serif characters that are valid Japanese Kanji are actually MS PGothic, and all thinner except first glyph.
- All sans-serif characters that are not Japanese Kanji but valid Simplified Chinese are actually SimHei.
On Windows Vista/7 or Windows XP with 微軟正黑體 installed, something changes. Let's load sample-05-opera.fonts.vista7.html under the condition mentioned above:
The red arrow indicates the default rendered result, and the red square indicates where a glyph came from. So you will find out that:
- Just like IE, Opera uses serif font as default web font.
- All latin-1 serif characters are actually Times New Roman.
- All latin-1 sans-serif characters are actually Arial.
- All serif double-byte-width symbol are actually smoothed MS PMincho.
- All serif characters that are valid Japanese Kanji are actually MS PMincho, and all smoothed except first glyph.
- All serif characters that are not Japanese Kanji but valid Simplified Chinese are actually not-smoothed SimSun.
- All sans-serif double-byte-width symbol are actually smoothed MS PGothic.
- All sans-serif characters that are valid Japanese Kanji are actually MS PGothic, and all thinner except first glyph.
- All sans-serif characters that are not Japanese Kanji but valid Simplified Chinese are actually 微軟正黑體. (No more SimHei here.)
We have not done yet. Now let's load sample-06-opera.fonts.pre.01.html into Opera to see how about the preformatted text font:
The red arrow indicates the default rendered result, and the red square indicates where a glyph came from. So you will find out that:
- Almost all preformatted latin-1 characters are actulaly Courier New.
- All preformatted double-byte-width symbol are exactally like serif, i.e., smoothed MS PMincho.
- All preformatted characters that are valid Japanese Kanji are like sans-serif, i.e., MS PGothic, but not thinner at all.
- All preformatted characters that are not valid Japanese Kanji but valid Simplified Chinese are like serif, i.e., SimSun, but smoothed.
You might also noticed that the single-byte-width brackets are not match to each other. Let's load sample-07-opera.fonts.pre.02.html into Opera to take a closer look at this issue:
In this sample file, there are some extra testing material:
!@#$%
There are five symbol, first with two leading space, second with leading double-byte-width asterisk "*".
The green square indicates what behaves normal, and the red square indicates what behaves wrong. So you can see, any double-byte-width symbol followed by some single-byte-width symbol makes the single-byte-width symbol(s) fall into the wrong font.
What Should Be Done
So what would be the right fonts? First let's think about serif fonts. Please load sample-08-opera.fonts.ideal.01.html into Opera:
- All latin-1 serif characters should be Times New Roman.
- All Chinese serif characters should be 新細明體.
As to sans-serif fonts, we have to consider siturations with or without 微軟正黑體 available. On Windows XP without 微軟正黑體, it should be like what sample-09-opera.fonts.ideal.02.html shows:
- All latin-1 sans-serif characters should be Arial.
- All Chinese sans-serif characters should be 標楷體.
On Windows Vista, Windows 7, or Windows XP with 微軟正黑體, it should be like what sample-10-opera.fonts.ideal.03.html showns:
- All latin-1 sans-serif characters should be Arial.
- All Chinese sans-serif characters should be 微軟正黑體.
So how about preformatted text fonts? Let's rock sample-11-opera.fonts.ideal.04.html with Opera:
- All preformatted characters should be 細明體 (標楷體 will do, too.)
Note: In case you want to see all test in one page, use sample-12-lineup.html.
Yet More Problems
Theoretically, Taiwanese users may be able to tweak Opera to fix the fonts problem. But the truth is, there are more problems:
- The
xml:lang
attribution on any XHTML element will not effect how Opera use fonts.
- Changing Chinese traditional fonts in the Preference / Advanced / Fonts / International Fonts... opetion will not help. (Note: this in fact works with Opera 10.10, but not with 10.5x. Something is broken here. Another Note: even this works with Opera 10.10, the default auto-select-font mechanism somehow fails in Opera 10.10.)
- Changing the serif font in the Preference / Advanced / Fonts does not always work.
There are two more sample files to show the problem here:
- To change the fonts in the sample-13-fonts.change.via.CHS.html, one have to change the Chinese simplified fonts in the Preference / Advanced / Fonts / International Fonts... opetion. This is the only way.
- sample-14-fonts.change.via.Serif.Kanji.html is almost all the same with previous sample, but the previous setting will not change the fonts here. In order to change the fonts, one have to:
- Change the Japanese Kanji fonts in the Preference / Advanced / Fonts / International Fonts... opetion. Or,
- Change the serif font in the Preference / Advanced / Fonts. When this setting is able to render Chinese characters, it overrides the Japanese Kanji fonts setting mentioned above.
You may think that these two sample mixed several Simplified Chinese and Japanese Kanji characters so that Opera screws up. Well, take a look at this fully Traditional Chinese sample sample-15-fonts.change.via.Serif.Kanji.html, in order to change its fonts, one still have to:
- Change the Japanese Kanji fonts in the Preference / Advanced / Fonts / International Fonts... opetion. Or,
- Change the serif font in the Preference / Advanced / Fonts. When this setting is able to render Chinese characters, it overrides the Japanese Kanji fonts setting mentioned above.
It is still unclear how or why Opera changes its fonts behavior according to actual web content. For years, Opera does not play good with Traditional Chinese content, and all Taiwanese users are looking forward to someday Opera finally fixed these problems. Until that day, Taiwanese users have no choose but change Traditional Chinese fonts, Simplified Chinese fonts, Japanese Kanji fonts, and all serif fonts and sans-serif fonts, just for using Traditional Chinese web content. How sad.