2011-06-22 11:54, Rick Gordon wrote:
Is there some way to map a font-variant or text-transform
> to a specific font, without doing the expected variant/transform?
No.
For instance, say I was using a style that had font-variant:small-caps
> and also has Copperplate (a natively small-cap font) as the preferred
font.
Browsers are rather... underdeveloped in matters like this. This could
depend on font properties (I tested with a version of Copperplate Gothic
downloadable as a purportedly free font from
http://www.webpagepublicity.com/free-fonts-c4.html ) but both Firefox
and IE seem to do nasty things. If I set just
font-family: "Copperplate Gothic Light"
things are OK, but when I add
font-variant: small-caps
the letters become somewhat smaller and thinner. You can see this if you
compare the same text in large font size in Copperplate Gothic Light,
both without font-variant: small-caps and with it.
Apparently they don't know it's a small-caps font and they
algorithmically modify its uppercase letters to produce fake small-caps
(as they generally do).
> So I would want the following set of responses:
1) If Copperplate is available, set it as normal normal bold 1.2em Copperplate
2) If Copperplate is not available, set it as normal small-caps bold 1.1em
Verdana (or default sans-serif)
Could this be accomplished with CSS alone,
No.
> or would it require Javascript?
As far as I know, it cannot be done even with JavaScript. In JavaScript,
you can at most read the style sheet rules that apply to an element -
such as the font-family property value, but you won't see which of its
values, if any, is the font actually used, still less set it.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
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/