.CSS style sheets, font question

A

Algomeysa2

It's been awhile since I've used .CSS files.

I'm having a little trouble getting my groove back.

I know that if you specify the font in the .CSS file (example: font-family:
Arial), it doesn't seem to be case-sensitive, for example, I could put
either "Arial" or "arial."

But other names, I'm a little fuzzier on. My reference book mentions the
"trebuchet" font, but in my windows fonts directory my font is named
"trebuchet MS", and if I just use "trebuchet" the font won't display, it
just uses a default font.

Ok, so that would seem simple enough: use the exact name of the font.

But... my book also mentions using, for example, "Times" or "Courier", and
I don't have those fonts in my windows control panel, fonts directory: I
have "Times New Roman" and "Courier New."

So it seems to be able to extrapolate to use the Times New Roman one when
it's told to use Times, or the Courier New one when it's told to use
Courier.

Yet it can't use Trebuchet MS when told to use Trebuchet.

How can I tell which fonts are safe to use?

I know I can be safer by writing, for example:
font-family: Comic Sans MS, Arial, sans-serif;

by which, I'm assuming, the user's browser will use Comic Sans MS if it's
got it, then, if not, it'll use Arial, which is so common that the user will
almost certainly have it, and if that doesn't work, it just goes and grabs
some other sans-serif font, if I understand correctly.

The book I'm using gives examples like using Arial, Helvetica, Verdana,
Georgia fonts. I've got all those except Helvetica, but I'm just wondering
how universal these fonts are in people's browsers. I mean, obviously,
you don't want to use some wacky Klingon TrueType font that only a handful
of people would have, but what can I assume almost everybody has?

So...to sum up....
1) what fonts are safest to use?
2) how is it that my browser (IE) seems to be able to generalize that
"Times" = "Times New Roman", and "Courier" = "Courier New", but not
"Trebuchet" = "Trebuchet MS" ?
 
A

Alan J. Flavell

On Mon, 30 Jan 2006, Algomeysa2 wrote:

[...]
My reference book mentions the
"trebuchet" font, but in my windows fonts directory my font is named
"trebuchet MS", and if I just use "trebuchet" the font won't display, it
just uses a default font.

I'm sure that the CSS spec was quite intentional when it didn't
specify exactly how font names are to be resolved. Implementers are
supposed to work out their own ideas of how to implement a fuzzy match
when an exact match isn't found.
How can I tell which fonts are safe to use?

Basically, reviewing the history of font support in browsers, I'd
conclude that /none/ are entirely safe to use. You have to interpret
"safe" in some kind of context.

"Successfully" selecting a named font which, on the user's system, has
a restricted character repertoire, could make your document unreadable
or inaccurate. You have no way of knowing whether their "Arial" is
the totally inadequate USA-specific version that was distributed with
Win95, or the WGL4-ish version that comes with XA, or anything in
between. They're all called "Arial" and you can't, in CSS, specify a
minimum version number; there's supposed to be a way of specifying
character repertoires, but they aren't widely supported, and the most
widespread faults in this area are exhibited by a browser-like object
with poor CSS support anyway, namely MSIE.

The user might have installed and selected a much better font than the
default they got with their OS - only to get it trampled on by your
CSS.

Nowadays, browser support for the generic CSS font names, such as
sans-serif, is OK; but in older versions of MSIE, it was appalling.

So what do you mean by "safe" ?
I know I can be safer by writing, for example:
font-family: Comic Sans MS, Arial, sans-serif;

That's plain silly. Those fonts are so unlike each other that you
might as well not specify anything, and leave the reader's default
choice to be in effect.
I mean, obviously, you don't want to use some wacky Klingon TrueType
font that only a handful of people would have,

That opens a *completely* different can of worms. Well, serpents
rather than mere worms...
but what can I assume almost everybody has?

You know what they say about "assume" :-}

I'd say there's no one-size-fits-all answer to your question. You
need to understand more about the detailed issues, and then decide
what is the best compromise - because it *is* always going to be a
compromise of one kind or another - *in the context of what you are
doing, and what your users need*.

good luck
 
M

Mike Massonnet

Algomeysa2 said:
But other names, I'm a little fuzzier on.   My reference book mentions the
"trebuchet" font, but in my windows fonts directory my font is named
"trebuchet MS", and if I just use "trebuchet" the font won't display, it
just uses a default font.

font-family:trebuchet,trebuchet ms,arial,sans-serif;
bye
 
P

Philip Ronan

Algomeysa2 said:
what can I assume almost everybody has?

You can't really. Just specify the fonts you would like, and add a fallback
selected from the following; serif, sans-serif, monospace, fantasy and
cursive.

The only sorts of fonts that appear on every system are fairly generic anyway
-- (e.g., Times/Times New Roman, Arial/Helvetica, Courier/Courier New. There
isn't much point in specifying these fonts because they are often used as
default settings anyway.
 
M

Mark Parnell

Deciding to do something for the good of humanity, Mike Massonnet
font-family:trebuchet,trebuchet ms,arial,sans-serif;

Invalid. Any font names containing spaces need to be quoted.
 
T

Toby Inkster

Philip said:
You can't really. Just specify the fonts you would like, and add a fallback
selected from the following; serif, sans-serif, monospace, fantasy and
cursive.

Though what "fantasy" and "cursive" are supposed to mean is anybody's
guess. Although those two are defined as generic font names in CSS, I'd
suggest it's best to stick with serif, sans-serif and monospace.
 
A

Alan J. Flavell


Which recommends:

|| body {
|| font-family: verdana, "trebuchet MS", helvetica, sans-serif;
|| }

without any mention of the consequences.

Either the author is unaware of the issues explored at
http://www.xs4all.nl/~sbpoley/webmatters/verdana.html ,
or has chosen to keep them quiet.

As has been said so many times before: Verdana is a fine font for its
purpose (good readability at a given nominal point size); but throwing
it into a mix with other fonts in an author style sheet for body text,
in the absence of widespread support for some kind of font-size-adjust
correction, is really not a good idea.

There was a time when most users had displays of limited resolution
and display quality, and every gram of extra readability would have
been beneficial. I'd say that's no longer the case, added to which
there is ever increasing diversity in display situations. Trying to
find a single CSS display style which fits every situation is getting
less and less tenable, IMO.

Let readers select Verdana for themselves, at their preferred size, if
they feel they need it for body text. By all means propose fonts from
the author stylesheet for particular display texts, which are going to
be displayed large anyway and where readability is unlikely to be
critical, such as headings; but large areas of body text can get
uncomfortable to read in an unsuitable font/size combination.

Browsers install with a font/size which the vendor supposes to be
acceptable to most users, and can be adjusted by the user if it's
inappropriate - why, oh WHY, do so many document authors insist that
they know better about this, and that their own choice is meant to be
good - no matter what the resolution and quality of the display, and
the visual acuity of the reader?

And, again, that's before we start to consider the question of the
character repertoire supported by various fonts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top