Am 09.07.11 09:32, schrieb Chris Blake:
> Hey,
>
> I am making a website that will be in two languages, English and
> Chinese. I am going to use my own webfonts but the font I am using for
> the English side doesn't have Chinese variations. I have found another
> font for the Chinese and was wondering if I can have more than one
> custom font e.g.
>
> #quotes h4{
> color: #3B7E71;
> font-family: 'englishfont', 'chinesefont', Arial, sans-serif;
> font-size: 18px;
> }
This fallback does not work for *single characters* in the font.
Your font-family declaration tells the browser to use "chinesefont" if
"englishfont" is not available/can not be loaded *as a whole*.
Instead, you might want to mark up your page with appropriate language
attributes e.g.:
<html lang="zh-tw">
...
<div id="quotes">
<h4>你好世界</h4>
...
and
<html lang="en">
...
<div id="quotes">
<h4>Hello world</h4>
...
In your style sheet you could then say:
html:lang(zh-tw) #quotes h4 {
font-family: 'chinesefont', Arial, sans-serif;
}
html:lang(en) #quotes h4 {
font-family: 'englishfont', Arial, sans-serif;
}
ta-da, a simple, language-based style switcher.
hope this helps,
Jørgen
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/