Am 09.07.11 19:50, schrieb Jukka K. Korpela:
2011-07-09 19:58, Joergen W. Lang wrote:
> font-family: 'englishfont', 'chinesefont', Arial, sans-serif;
[...]
This fallback does not work for *single characters* in the font.
That depends on the browser.
Is there a list of browsers that support single glyph substitution and
how they do it?
The specs do not seem to be very specific about the handling of missing
glyph substitution. (1,2)
[...]
Instead, you might want to mark up your page with appropriate language
attributes e.g.:
Maybe, but it's not safe to rely on them in styling.
You seem to be describing mostly IE behavior. ;o)
html:lang(zh-tw) #quotes h4 {
The :lang(...) pseudoclass is not supported by IE 7 and older, so it's
safer to add a class attribute, say class="zh" or class="en", and use
class selectors, which are supported by all CSS-enabled browsers.
I take your point regarding backwards compatibility. OTOH usage of the
lang attribute is not only semantically correct, but also recommended by
the W3C (3,4).
Instead of using 'class' a better fallback might be to use a simple
attribute selector, which actually is supported by IE7. So instead of
(or in addition to) using :lang, Chris might also use
html[lang="zh-tw"] #quotes h4 {...}
Jørgen
===
1) http://www.w3.org/TR/CSS21/fonts.html#propdef-font-family:
"The property value is a prioritized list of font family names..."
and
"Although many fonts provide the "missing character" glyph [...] this
should not be considered a match for characters that cannot be found in
the font."
2) http://www.w3.org/TR/css3-fonts/#font-family-prop (03/24/2011)
"A user agent iterates through the list of family names until it matches
an available font that contains *a glyph for the character* to be rendered."
3) http://www.w3.org/International/questions/qa-lang-why.en.php#fonts
4) http://www.w3.org/International/questions/qa-css-lang
______________________________________________________________________
css-discuss [[email protected]]
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/