[log in to unmask] writes:
> Can the style mechanism be defined to prevent a style definition from
> changing the charset of the text? For example,
> <P STYLE="face=symbol">abcd
People that do this exploit a bug in some browsers. They rely on the
browser using 8 bits internally, on a certain 8-bit font encoding
vector, and on the browser not checking this vector for validity.
> If you want the symbols for abcd then entities or unicode references should
> be used. This problem can be taken even further by using the style tag to
> switch to a Thai or Eastern European charset font. There are pages doing this
> right now using the FONT tag.
`Should' isn't the right word. The fact is that the Symbol font
*doesn't have* glyphs for abcd, so a correct browser will use a
back-up font instead. To get the lowercase alpha, beta, chi and delta,
you'll have to use something like α, β, ξ and δ
(not yet defined in HTML) or α, β, γ and δ
(already possible, but not widely implemented).
> I would like to see style-based charset swapping defined as an ERROR and not
> have the browser be "forgiving" and display it anyway. If this isn't defined
> as an ERROR all browser vendors are going to have to figure out how to make
> this mess portable.
It is not necessary for a style sheet standard or for HTML to
explicitly define this behaviour as an error. CSS, for example,
doesn't have a concept of explicit character to glyph mapping, so this
issue doesn't come up for CSS.
On the other hand, the DSSSL style language offers the possibility to
explicitly remap characters to glyphs, so you can (with some effort)
define the `a' to produce an alpha instead. It can be abused, but it
is sometimes necessary and HTML shouldn't forbid it.
Bert Bos ( W 3 C ) http://www.w3.org/
[log in to unmask] INRIA project RODEO/W3C
http://www.w3.org/pub/WWW/People/Bos/ 2004 Rt des Lucioles / BP 93
+33 93 65 77 71 06902 Sophia Antipolis Cedex, France