473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

font-family CSS property with IE6?

Is there a problem with the CSS font-family property with IE6 -
or is it my understanding of the font-family property?

I was under the impression that the browser tried to use the
first font. If it couldn't find that font it used the next on
the list and so on. If it couldn't find any on the list, prior
to the last it would use the last - which, as you can see is
sans-serif here.

When I use the following style I get what I think is the default
system font - which is a SERIF font. Note that all the fonts in
the list below are SANS-SERIF.

Is this an IE bug or am I mis-using the font-family property?

I running XP pro SP2 with this version of IE: IE
6.0.2800.1106.xpsp1

"Trebuchet MS" and Verdana are both displayed without a problem.

+++ +++ +++ +++ +++
Here is my class definition. It's applied to <span> and <p>
+++ +++ +++ +++ +++

..dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
FONT-SIZE: 13px;
font-weight: bold;
color: #603eA2;
cursor: default;
background-image: url(http://eg/images/grid.gif);
width:120px;
margin-top: 0px;
margin-bottom: 0px}

+++ +++ +++ +++ +++

Jul 20 '05 #1
9 8965
On Fri, 09 Jul 2004 16:07:07 +0100, Zenobia <6.**********@spamgourmet.com>
wrote:
Is there a problem with the CSS font-family property with IE6 -
or is it my understanding of the font-family property?

I was under the impression that the browser tried to use the
first font. If it couldn't find that font it used the next on
the list and so on. If it couldn't find any on the list, prior
to the last it would use the last - which, as you can see is
sans-serif here.

When I use the following style I get what I think is the default
system font - which is a SERIF font. Note that all the fonts in
the list below are SANS-SERIF.

Is this an IE bug or am I mis-using the font-family property?

I running XP pro SP2 with this version of IE: IE
6.0.2800.1106.xpsp1

"Trebuchet MS" and Verdana are both displayed without a problem.

+++ +++ +++ +++ +++
Here is my class definition. It's applied to <span> and <p>
+++ +++ +++ +++ +++

.dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
FONT-SIZE: 13px;
font-weight: bold;
color: #603eA2;
cursor: default;
background-image: url(http://eg/images/grid.gif);
width:120px;
margin-top: 0px;
margin-bottom: 0px}

+++ +++ +++ +++ +++


1) Need more info than this, please post URL to an example of the problem.

2) My guess is that there's a font element overriding the CSS declaration.
Can't know for sure.

3) While we're on the subject of fonts, px or pt is a poor choice for
screen. % is best - 100% being the user's preferred reading size. Change
width to ems too. And span is inline, while p is block - you do know the
difference, right? BTW 0 distances don't use a measurement - so not 0px,
but just 0.

I recommend simplifying the test case, remove all styles but the
font-family, and see if the problem is replicated. If so, post URL to test
case.
Jul 20 '05 #2
Els
Zenobia wrote:
Is there a problem with the CSS font-family property with
IE6 - or is it my understanding of the font-family
property?

I was under the impression that the browser tried to use
the first font. If it couldn't find that font it used the
next on the list and so on. If it couldn't find any on the
list, prior to the last it would use the last - which, as
you can see is sans-serif here.

When I use the following style I get what I think is the
default system font - which is a SERIF font. Note that all
the fonts in the list below are SANS-SERIF.

Is this an IE bug or am I mis-using the font-family
property?

I running XP pro SP2 with this version of IE: IE
6.0.2800.1106.xpsp1

"Trebuchet MS" and Verdana are both displayed without a
problem.

+++ +++ +++ +++ +++
Here is my class definition. It's applied to <span> and <p>
+++ +++ +++ +++ +++

.dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
FONT-SIZE: 13px;
font-weight: bold;
color: #603eA2;
cursor: default;
background-image: url(http://eg/images/grid.gif);
width:120px;
margin-top: 0px;
margin-bottom: 0px}

+++ +++ +++ +++ +++


Do you have it uploaded somewhere?
It could be an error in the stylesheet just before the a.m.
style, which would make this style not get read, or it could
be in your html somewhere.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Ofra Haza - Im Nin'alu
Jul 20 '05 #3
On Fri, 9 Jul 2004, Zenobia wrote:
When I use the following style I get what I think is the default
system font - which is a SERIF font. Note that all the fonts in
the list below are SANS-SERIF.

.dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
Shruti is a Gujarati font and does not contain ASCII glyphs.
What are you going to achieve?
[sans-]serif is meaningless to Indic typefaces.
FONT-SIZE: 13px;


Don't do that!

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #4
On Fri, 09 Jul 2004 11:19:56 -0400, Neal <ne*****@yahoo.com> wrote:
Change width to ems too.


I meant % - though ems should be OK as well.
Jul 20 '05 #5
On Fri, 9 Jul 2004, I wrote:
Shruti is a Gujarati font and does not contain ASCII glyphs.


<http://www.alanwood.net/unicode/fonts_windows.html>
claims that Mangal, Raavi, shruti contain ASCII glyphs -
but they don't.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #6
On Fri, 9 Jul 2004, I wrote:
Shruti is a Gujarati font and does not contain ASCII glyphs.


<http://www.alanwood.net/unicode/fonts_windows.html>
claims that Mangal, Raavi, shruti contain ASCII glyphs -


.... or perhaps not. Alan Wood writes

| Basic Latin (numerals and punctuation)

Perhaps he means

| Not Basic Latin but only numerals and punctuation

--
Top-posting.
What's the most irritating thing on Usenet?
Jul 20 '05 #7

This is a CSS question - might I suggest in future to redirect
the thread at an earlier stage when this happens? ta.
x-posted and f'ups proposed...

On Fri, 9 Jul 2004, Andreas Prilop wrote:
On Fri, 9 Jul 2004, Zenobia wrote:
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
Shruti is a Gujarati font and does not contain ASCII glyphs.


I'd never heard of it before, but a google search led me to a
collection of (allegedly) free fonts at computingbydsn, and I've
just tried installing it to see. MS Font Property Extensions
says the only supported Unicode range(s) is Gujarati, but Listfont
appears to show lots of stuff including Latin-1, Greek, Cyrillic and
so on - is this some artefact of font handling or what?
What are you going to achieve?


Presumably, it's meant to achieve what's described at
http://www.w3.org/TR/REC-CSS2/fonts....nt-family-prop

To deal with the problem that a single font may not contain glyphs to
display all the characters in a document, [...]
this property allows authors to specify a
list of fonts, all of the same style and size, that are tried in
sequence to see if they contain a glyph for a certain character. This
list is called a font set.

So, according to the CSS specification, this is /supposed/ to take
from Shruti whatever characters it contains, and for characters which
it does not contain, to use one of the fonts named later in the list.

How well supported that is across the available browsers is a topic
that has been discussed, at least in general terms, on a number of
previous occasions, with somewhat mixed conclusions. Don't you think
it'll work - in general - or in this case specifically?

If the original poster would provide a demonstration URL, then we
might make some progress (hint).

Incidentally, if I ask IE to configure a default font for Gujarati,
the only options it offers me are Arial Unicode MS, Code2000 (which I
installed for purely experimental reasons) and (now) Shruti. (Oh, and
for a monospaced font I get no choices whatever).

Of course the usual caveats about Verdana have to be repeated.[1]
FONT-SIZE: 13px;


Don't do that!


Agreed! With knobs on!!

[1] See e.g http://www.xs4all.nl/~sbpoley/webmatters/verdana.html

Jul 20 '05 #8
On 9 Jul 2004 15:20:00 GMT, Els <el*********@tiscali.nl> wrote:
Zenobia wrote:
Is there a problem with the CSS font-family property with
IE6 - or is it my understanding of the font-family
property?

I was under the impression that the browser tried to use
the first font. If it couldn't find that font it used the
next on the list and so on. If it couldn't find any on the
list, prior to the last it would use the last - which, as
you can see is sans-serif here.

When I use the following style I get what I think is the
default system font - which is a SERIF font. Note that all
the fonts in the list below are SANS-SERIF.

Is this an IE bug or am I mis-using the font-family
property?

I running XP pro SP2 with this version of IE: IE
6.0.2800.1106.xpsp1

"Trebuchet MS" and Verdana are both displayed without a
problem.

+++ +++ +++ +++ +++
Here is my class definition. It's applied to <span> and <p>
+++ +++ +++ +++ +++

.dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
FONT-SIZE: 13px;
font-weight: bold;
color: #603eA2;
cursor: default;
background-image: url(http://eg/images/grid.gif);
width:120px;
margin-top: 0px;
margin-bottom: 0px}

+++ +++ +++ +++ +++
Do you have it uploaded somewhere?


I can't give a URL because this is still being written.
It could be an error in the stylesheet just before the a.m.
style, which would make this style not get read, or it could
be in your html somewhere.


If I make one modification on this line, from:

font-family: Shruti, "Trebuchet MS", Verdana, Arial, Helvetica,
sans-serif;

to:

font-family: "Trebuchet MS", Verdana, Arial, Helvetica,
sans-serif;

then it's OK. I checked and my machine doesn't not have the
Shruti font installed.

I will look into Neal's suggestions.

Jul 20 '05 #9
On Fri, 9 Jul 2004 17:24:42 +0200, Andreas Prilop
<nh******@rrzn-user.uni-hannover.de> wrote:
On Fri, 9 Jul 2004, Zenobia wrote:
When I use the following style I get what I think is the default
system font - which is a SERIF font. Note that all the fonts in
the list below are SANS-SERIF.

.dateSpan {
font-family: Shruti, "Trebuchet MS", Verdana, Arial,
Helvetica, sans-serif;
Shruti is a Gujarati font and does not contain ASCII glyphs.


Ha. That's a good clue. Silly MS Word displays Shruti as
sans-serif (Verdana). That go me confused.
What are you going to achieve?
I was looking for the most attractive sans-serif font. I can't
find one with all the attibutes I like such as nice oval 0, a l
with a hint of a loop at the bottom, a g with a simple
descender, etc.
[sans-]serif is meaningless to Indic typefaces.
FONT-SIZE: 13px;


Don't do that!


OK. Thanks, people for your help. I'm clearly making lots of
mistakes with my CSS. I'll sort it out.

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
10
by: Richard R Plourde | last post by:
I've got a problem that IE doesn't seem to use the entire font unicode subgroups from a hinted font file. When I display the following web page in IE 6 as opposed to Firefox 1.0 PR. Check out...
9
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
1
by: Henry Jones | last post by:
I found some code to change the font on a button to bold: private void btnBold_Click(object sender, System.EventArgs e) { btnCalculate.Font = new Font(btnCalculate.Font, ...
17
by: teser3 | last post by:
I can put out a Word Doc from PHP but if I try and manipulate the font size in the PHP part it outputs a blank Word Document. Here is what I have: <?php $fname="report.doc"; $handle = fopen(...
27
by: 1001 Webs | last post by:
I am trying to make my style sheet as compatible as possible and I'm getting a bit confused here. I've read that the best size for font-size would be 76.1%; due to shortcomings in the way both...
16
by: carlbernardi | last post by:
Hi, I was wondering if there is way use a font that is somehow kept in the code instead of having to load it? I am working on a single script that so far can produce images and html but I have...
6
by: Miro | last post by:
Is there a way to / or a mathematical formula to see if a font size is 'too big' for a label. I have a label that is docked to 'fill' a form, and I want to resize that font based on the width...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.