469,282 Members | 1,704 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Problems with Firefox and font-family property

I am having some issues with Firefox not rendering an element with the
correct font. I am using the font-family style within a stylesheet class
definition. I then set the element I am creating to use that class and the
font is not showing correctly. If I set the font-family to "arial" or
"Comic Sans MS" the font shows correctly, however I am trying to use the
"Webdings" font, which is installed on my computer. All fonts show
correctly using IE6. Any ideas?

..cartSlct
{
font-family:webdings;
font-size:12pt;
cursor:default;
width:5%;
}

cellSlct=newRow.insertCell(-1)
cellSlct.appendChild(winDVDCart.document.createTex tNode("4"))

The text should display as an arrow pointing to the right
Jul 21 '05 #1
12 18111
David wrote:
I am having some issues with Firefox not rendering an element with the
correct font. I am using the font-family style within a stylesheet class
definition. I then set the element I am creating to use that class and the
font is not showing correctly. If I set the font-family to "arial" or
"Comic Sans MS" the font shows correctly, however I am trying to use the
"Webdings" font, which is installed on my computer. All fonts show
correctly using IE6. Any ideas?

.cartSlct
{
font-family:webdings;
font-size:12pt;
cursor:default;
width:5%;
}

cellSlct=newRow.insertCell(-1)
cellSlct.appendChild(winDVDCart.document.createTex tNode("4"))

The text should display as an arrow pointing to the right


If you want a right arrow, use the proper HTML character entity, i.e.
'→' or '→'.
Jul 21 '05 #2
On Mon, 18 Jul 2005, David wrote:
however I am trying to use the "Webdings" font,
Don't do that!
http://ppewww.ph.gla.ac.uk/~flavell/...e-harmful.html
which is installed on my computer.
But not on mine.
All fonts show correctly using IE6.


No! Maybe Internet Exploder shows you the page as *you expected*.
But that isn't correct. IE is broken since it displays, e.g.
<font face="Symbol">&Ouml;</font>
as a square root sign. But &Ouml; is an umlaut, not a square root.
http://www.unics.uni-hannover.de/nht...quareroot.html

Jul 21 '05 #3
C A Upsdell wrote:
If you want a right arrow, use the proper HTML character entity, i.e.
'&rarr;' or '→'.


Well, the right arrow that I would LIKE to use is actually the HTML
character entity '&rArr;' or '⇒' but now IE has decided it doesn't
like that one and only displays a box. In addition, how would I put an HTML
character entity reference into my createTextNode statement, it doesn't seem
to interpret anything as anything more than text.

cellSlct.appendChild(winDVDCart.document.createTex tNode("&rArr;"))

How should this look? (sorry if this question should actually be posted
somewhere else, but since I started the topic here....)
Jul 21 '05 #4
David wrote:
C A Upsdell wrote:

If you want a right arrow, use the proper HTML character entity, i.e.
'&rarr;' or '→'.

Well, the right arrow that I would LIKE to use is actually the HTML
character entity '&rArr;' or '⇒' but now IE has decided it doesn't
like that one and only displays a box. In addition, how would I put an HTML
character entity reference into my createTextNode statement, it doesn't seem
to interpret anything as anything more than text.

cellSlct.appendChild(winDVDCart.document.createTex tNode("&rArr;"))

How should this look? (sorry if this question should actually be posted
somewhere else, but since I started the topic here....)


The character entity IS text.

Jul 21 '05 #5
C A Upsdell wrote:
David wrote:
C A Upsdell wrote:

If you want a right arrow, use the proper HTML character entity, i.e.
'&rarr;' or '→'.

Well, the right arrow that I would LIKE to use is actually the HTML
character entity '&rArr;' or '⇒' but now IE has decided it doesn't
like that one and only displays a box. In addition, how would I put an
HTML character entity reference into my createTextNode statement, it
doesn't seem to interpret anything as anything more than text.

cellSlct.appendChild(winDVDCart.document.createTex tNode("&rArr;"))

How should this look? (sorry if this question should actually be posted
somewhere else, but since I started the topic here....)


The character entity IS text.


Ok, so since the character entity IS text, then that should mean that I
wouldn't need the quotes around it? When I leave it without the quotes I
start getting script errors in other places in my document, obviously a
result of taking it out of quotes. How should I go about creating a text
node with that value in it? Also, any ideas why IE6 won't display the
&rArr; character but has no problems displaying the other one, &rarr; ??
Sorry for my ignorance on this topic, it is all kind of new to me.
Jul 21 '05 #6
On Tue, 19 Jul 2005, David wrote:
Ok, so since the character entity IS text, then that should mean
that I wouldn't need the quotes around it?
You're one step further away from what we usually discuss here, namely
some static HTML (or xhtml) with a stylesheet to propose presentation.

You're evidently generating something programmatically. How you do
that is your concern, I'm starting from the result of that program...

The important part, for the current discussion, is the HTML (it
defines the /content/), which makes it really off-topic for this
group, but I'm tackling the question where I found it, for now.

There are (potentially) three ways to represent a character: the coded
character itself, its numeric character reference &#number; (decimal
or hex), or, where available, a character entity &whatever;

If you decide which you prefer, and inject that with whatever software
it is that you're using, then the problem is solved, theoretically.
Also, any ideas why IE6 won't display the &rArr; character but has
no problems displaying the other one, &rarr; ??


Possibly a font limitation. The single arrows are in MS WGL4, so
they'd likely be in any current MS font that offers a wide repertoire
of basically Western characters. The double arrow is not, however.

But it seems to work for me if I choose Lucida Sans Unicode as IE's
default font.

hope this helps a bit

Remark: In general in a web context you have no idea which fonts your
readers may have available. Even if you guess, there are different
versions of the same-named font that have different (sometimes very
different) repertoires. So you do better, in a situation where
unusual characters are needed, /not/ to try to influence their font
choice from a stylesheet.
Jul 21 '05 #7
"David" <dk****@hotmail.com> wrote:
cellSlct.appendChild(winDVDCart.document.createTex tNode("&rArr;"))


Script elements contain character data, not parsed character data
(which may contain entites which will be parsed by the browser).

So you have to use Unicode to denote the character, "\u21D2" in this
case.

Make a post to comp.lang.javascript, if you want to follow-up on this
subject.

Bye,
Martin
Jul 21 '05 #8

On Tue, 19 Jul 2005, Alan J. Flavell wrote:
There are (potentially) three ways to represent a character: the coded
character itself, its numeric character reference &#number; (decimal
or hex), or, where available, a character entity &whatever;


I gather from other followups since, that the second and third options
aren't available to you in your particular context. Apologies if I caused
any confusion.

Jul 21 '05 #9
Alan J. Flavell wrote:

On Tue, 19 Jul 2005, Alan J. Flavell wrote:
There are (potentially) three ways to represent a character: the coded
character itself, its numeric character reference &#number; (decimal
or hex), or, where available, a character entity &whatever;


I gather from other followups since, that the second and third options
aren't available to you in your particular context. Apologies if I caused
any confusion.


No problem, I was able to use the Unicode character code "\u21D2" to get the
character I was looking for, though I am disappointed that the character for
&rArr; will not show up on IE6 under any font I try. Anyways, thanks to
all.
Jul 21 '05 #10
On Mon, 18 Jul 2005 15:22:35 -0700, "David" <dk****@hotmail.com> wrote
or quoted :
All fonts show
correctly using IE6. Any ideas?


Try http://mindprod.com/applets/fontshower.html

to see what fonts are installed on your machine and precisely what
they are called.

Whether it officially matters or not, it is a good idea to get the
case right and exactly where the spaces go.

You are not supposed to put quotes around the generic font names like
sans-serif

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #11
On Mon, 18 Jul 2005 15:22:35 -0700, "David" <dk****@hotmail.com> wrote
or quoted :
font-family:webdings;


Webdings may presume you have

<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

It might not have proper Unicode mappings for the entities.

Try just using the unicode entity and leaving the font as is.

See http://mindprod.com/jgloss/unicode.html
or
http://mindprod.com/jgloss/htmlcheat...CIALCHARACTERS

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #12
On Wed, 20 Jul 2005, David wrote:
No problem, I was able to use the Unicode character code "\u21D2" to
get the character I was looking for, though I am disappointed that
the character for &rArr; will not show up on IE6 under any font I
try.


IE is very strange in some regards. I don't understand the internals,
but I've set out some of my observations, amongst other browsers, at
http://ppewww.ph.gla.ac.uk/~flavell/...ers-fonts.html

However, I'm definite that "Lucida Sans Unicode" contains this
character (I've browsed the font with SIL Viewglyph to be sure).

Arial (the regular font, not the big unicode one) doesn't have the
double arrow, on the other hand.

What struck me as completely bizarre was that when, by chance, I
enabled Japanese language support, IE started to display a whole lot
of extra characters of this kind - even ones which weren't present in
the selected font. Sure: once that has been done, it's hard to
disentangle what's really happening. But I think the SIL Viewglyph
font browser is telling the truth as regards which characters are
really in each font.

I admit that telling your readers that they'd get better display of
these characters by installing Japanese support is quite likely to
"get some funny looks", but it seems to be the case, even so. (Tried
with Win/2K Pro and XP Pro).

cheers
Jul 24 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by yoni cohen | last post: by
6 posts views Thread by mike | last post: by
35 posts views Thread by Aaron Gray | last post: by
3 posts views Thread by Tyrone Slothrop | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.