Thu 23 Aug 2007 11:28:45 PM UTC, original submission:
PROBLEM:
CJK (chinese/japanese/korean) characters are frequently
shown on a screen as a "double width" font. Latin text mixed in with
CJK text - e.g. a samizdat page in which not all the articles have been
translated into Japanese - is best shown as a single width font.
However, the CJK codings as well as (usually) the CJK fonts (AFAIK)
have their own additional copy of latin letters - after all, just 52
letters and a few punctuation characters is almost nothing compared to
a few thousand kanji. This additional copy in the font is presented as
a double width font. And these latin letters look ugly. Text in this
looks like there's an extra space between every letter and it's rather
difficult to read. T r y r e a d i n g t h i s a n d s e e i f
y o u l i k e i t .
On my browser (firefox 1.0.4-2sarge17), the japanese appears as a
double width font and the other text also shows up as a double width font,
whereas the other text should appear as a single width font - as it
did in earlier versions of samizdat - i'm not quite sure how long ago.
konqueror-3.3.2 does not have this problem
If this is only a problem for me, then it's not a serious problem, but
if it occurs for a large number of users, then it is a serious problem.
POSSIBLE SOLUTIONS:
(1) BAD solution: remove xml attribute of <html> tag
This bad solution probably shows something about the problem:
templates/page_layout.rhtml has the line:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= Locale.get %>" lang="<%= Locale.get %>">
which looks like
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
in the html code of a rendered page.
Remove
xml:lang="ja" lang="ja"
and the problem is solved.
(2) possibly acceptable solution:
Here is one solution based on the recommendations in:
http://www.w3.org/International/questions/qa-css-lang.en.php
This works for me (without removing 'xml:lang="ja" lang="ja"').
An argument against this solution is that having to define a
particular font family for a particular seems a bit too hardwired. It
would also mean that similar lines would have to be added for every CJK
language variant.
(3) not as good as (2), but required to satisfy the non-standard browser "IE"
The same w3.org page says that solution (2) won't work for internet exploder:
http://www.w3.org/International/questions/qa-css-lang.en.php
So a solution that should work here is to use a css class instead of
the xml language feature. This requires a small hack to page_layout.html
giving:
<html xmlns="http://www.w3.org/1999/xhtml" class="ja" xml:lang="ja" lang="ja">
DISCUSSION:
This last solution (3) seems rather ugly to me and that's what the w3.org
people seem to argue as well. However, we don't want to exclude
disadvantaged people (those using IE) when an easy hack can satisfy
them. Maybe we should have a global variable @@ie_hacks so that people
willing to ignore the problems of IE users can set @@ie_hacks = false ...?
However, even (2) seems to me a bit too hardwired. On the other hand,
it should not interfere with non-CJK scripts and it should be easy to
reverse if a better solution comes along later.
A relevant email i found was here, but it's from back in 2000:
http://mail.nl.linux.org/linux-utf8/2000-02/msg00033.html
i haven't found anything obvious and more recent.
i'm setting this as "minor" - we'll possibly see soon based on users'
reactions whether this is an important bug or not. At least we'll have
this hack solution ready in case nothing better comes along quickly.
|