Multiple fonts in font-family

B

Ben Amada

I'm maintaining a web site that someone else created with some HTML
generator. Throughout the site, the following "font-family" is used:

font-family: Tahoma, Arial, Helvetica, Geneva, Swiss, SunSans-Regular;

I'm just a beginner, but it seems to me that there are 6 different fonts
above. So which of the 6 fonts is being applied to the text? Why are 6
different fonts being specified?

Thanks in advance,
Ben
 
J

JustAnotherGuy

Ben said:
I'm maintaining a web site that someone else created with some HTML
generator. Throughout the site, the following "font-family" is used:

font-family: Tahoma, Arial, Helvetica, Geneva, Swiss, SunSans-Regular;

I'm just a beginner, but it seems to me that there are 6 different fonts
above. So which of the 6 fonts is being applied to the text? Why are 6
different fonts being specified?

That's the order of priority of the fonts chosen. If Tahoma is not
available, Arial will be applied. If Arial is not available either,
Helvetica is applied. And so on. (If Tahoma is available, that's the
chosen font)

You might want to append a generic family to that. font-family: Tahoma,
Arial, Helvetica, Geneva, Swiss, SunSans-Regular, sans-serif;

I think that list mixes serif/sans-serif fonts, but I'm not sure.
 
M

Mark Parnell

font-family: Tahoma, Arial, Helvetica, Geneva, Swiss, SunSans-Regular;

I'm just a beginner, but it seems to me that there are 6 different fonts
above. So which of the 6 fonts is being applied to the text? Why are 6
different fonts being specified?

The first one that the visitor's computer has. They are specifying 6 in
case the user doesn't have some of them. They are in a somewhat strange
order, as Arial and Helvetica are probably the 2 most common there, so
it would be very rare for someone to get past them and have one of the
other 3. And you should always specify a generic font-family as a last
alternative. In the case above, that would be serif.

Judging from this and your other posts, it seems that a walk (or
several) through the specs may be in order.
http://www.w3.org/TR/REC-CSS2/
 
M

Mark Parnell

In the case above, that would be serif.
^^^^^^^
sans-serif

<bang bodypart="head" location="desk">
Must check what I am writing before sending
</bang>
 
R

rf

Ben Amada said:
I'm maintaining a web site that someone else created with some HTML
generator. Throughout the site, the following "font-family" is used:

font-family: Tahoma, Arial, Helvetica, Geneva, Swiss, SunSans-Regular;

I'm just a beginner, but it seems to me that there are 6 different fonts
above. So which of the 6 fonts is being applied to the text? Why are 6
different fonts being specified?

It's a list of preferred fonts. The first one that is installed on the
viewers system is used.

Cheers
Richard.
 
B

Ben Amada

Mark & JustAnotherGuy,

I understand now the purpose of the multiple fonts -- thanks for your
explanations.

Unfortunately, this font-family is used in many places on the website (as
opposed to just being defined once in a CSS sheet which would be a better
design). So I'll try to add "sans-serif" to the end of the list of fonts in
as many places as I can -- it would be very hard, tedious to correct all the
instances of this particular font-family at one time.
Judging from this and your other posts, it seems that a walk (or
several) through the specs may be in order.
http://www.w3.org/TR/REC-CSS2/

I appreciate the link -- I saved it and will use it as a reference. In
general, I try to get most of my information out of the Google archives
which is a great resource, then my second choice is asking questions in this
NG -- sometimes it's easier and more enjoyable to comprehend the answers I
get here from people like yourself rather than reading through the technical
documentation .. it's not that I'm lazy :)
<bang bodypart="head" location="desk">
Must check what I am writing before sending
</bang>

no problem :)

Thanks very much,
Ben
 
B

Blinky the Shark

Ben said:
Mark & JustAnotherGuy,

I understand now the purpose of the multiple fonts -- thanks for your
explanations.

Unfortunately, this font-family is used in many places on the website
(as opposed to just being defined once in a CSS sheet which would be a
better design). So I'll try to add "sans-serif" to the end of the list
of fonts in as many places as I can -- it would be very hard, tedious to
correct all the instances of this particular font-family at one time.

You could do a search/replace recursively, from the top of the directory
structure, with something like

replace arial
with arial,[space]sans-serif

(I *think* that would maintain syntax whether "arial" was followed by a
comma or not; i.e., whether it was the last of the series of fonts or
not.)

....and set it up for confirmation of each replacement. It'd be lot of
"hit confirm" grunt work, but not nearly as much as trying to do it
manually.

First Win tool that comes to mind that will do this is a freebie:
InfoRapid Search and Replace.
 
A

Andrew Glasgow

Ben Amada said:
Mark & JustAnotherGuy,

I understand now the purpose of the multiple fonts -- thanks for your
explanations.

Unfortunately, this font-family is used in many places on the website (as
opposed to just being defined once in a CSS sheet which would be a better
design). So I'll try to add "sans-serif" to the end of the list of fonts in
as many places as I can -- it would be very hard, tedious to correct all the
instances of this particular font-family at one time.

No it would not be, if you use the right tool. There are many programs
out there that allow you to do a search-and-replace over multiple text
files.

However, you'd get more milage out of redesigning your site so that
these things *are* defined once in a CSS sheet.
 
A

Andy Dingley

They are in a somewhat strange
order, as Arial and Helvetica are probably the 2 most common there, so
it would be very rare for someone to get past them and have one of the
other 3.

Arial is a M$oft typeface, so it's just not found on a bunch of other
platforms (and what's "SunSans" ? Was this authored on a Sun box ?)

"Helvetica" is heavily trademarked, hence the number of look-alike
typefaces for it with different names. It's unlikely to be available
_under_that_name_ unless someone is a professional designer who paid
money for the real thing (or a w4r3z k1dd13)
 
T

Toby A Inkster

Andy said:
Arial is a M$oft typeface, so it's just not found on a bunch of other
platforms

According to the Codestyle.org survey, it's installed on 93.64% of Macs
and 85.94% of Unix machines.
"Helvetica" is heavily trademarked, hence the number of look-alike
typefaces for it with different names. It's unlikely to be available
_under_that_name_ unless someone is a professional designer who paid
money for the real thing (or a w4r3z k1dd13)

I think it comes installed by default on most Macs and comes with
Ghostscript (which itself is on many Unix machines).
 
A

Andrew Glasgow

Andy Dingley said:
Arial is a M$oft typeface, so it's just not found on a bunch of other
platforms (and what's "SunSans" ? Was this authored on a Sun box ?)

"Helvetica" is heavily trademarked, hence the number of look-alike
typefaces for it with different names. It's unlikely to be available
_under_that_name_ unless someone is a professional designer who paid
money for the real thing (or a w4r3z k1dd13)

Helvetica is installed on pretty much every Mac by default.
 
J

Jukka K. Korpela

Ben Amada said:
I understand now the purpose of the multiple fonts

I think we just know what the font-family declaration means.
We really don't know what the _purpose_ of the designer was.
It looked like a pretty mixed list of fonts, not particularly well
chosen.

Besides, do we even know what the declaration means? At least many
browser vendors don't. It's _supposed_ to define a priority list that
will ultimately be applied to each character, but e.g. IE seems to
(mostly) just pick up the first font it finds and to apply it to the
element as a whole. This means that if there are some characters in the
text that have no glyphs in the font, they will appear as missing glyph
icons. Mozilla does a better job.
So I'll try to add "sans-serif" to the
end of the list of fonts in as many places as I can

Don't bother. Specifying sans-serif as the last option is not really
that relevant, unless you are using both serif and sans-serif fonts on
the page and which to maximize the odds of making a distinction.
Besides, the list is already so long that any user who hasn't got any
of the fonts is most probably interested in content, not font
esthetics, _or_ has forced his browser use his preferred fonts
no matter what authors say.
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top