Forum Moderators: open
Can someone tell me how to do that?
<font face="Other Font" size="3" color="red"> Text </font>
What is needed?
The user has to have the font on their computer. Using weird fonts which you may have downloaded off the internet or bought on a disk a user may not have which is why most people use fonts that everyone has ie Arial. If they don't have it I believe it will bring up the user's default font. If people usually want to use weird fonts they usually embed them in images
Is it really safe?
Yes. I've seen it done before but very rarely, probably because of the aforementioned reasons.
cmatcme
[codestyle.org...]
The best idea is to set font-family rather than font, and list several options so the browser that has no access to your most preferred font still has instructions for the next best choice.
Also note that the link I offered is the results of a survey - so it's only a rough idea and not a true market penetration report.
<font face="Other Font" size="3" color="red"> Text </font>
C'mon Cmatcme, there is really absolutely no reason to be doing it this way these days - especially for people starting out.
Silverbytes, a better way is to use css for defining your fonts. This also allows you to specify 'backup' fonts in case the 'first choice' font is not present on the visitor's system. For example, you could put the following code into the <head> section of an html document:
<style type="text/css">
body
{
font-family:arial,helvetica,tahoma,verdana,sans-serif;
font-size:11px;
line-height:14px;
}
</style>
This css will set all text in the body element to 'arial' (and everything that shows up on your page is in the body element). If arial is not present, it will go down the list, and if none of the named fonts is present at all, it will still default to whatever the user's system uses as the default sans-serif font.
For more information, check out the CSS Forum [webmasterworld.com] and the CSS Library [webmasterworld.com], or try a Google search for "CSS tutorial" [google.ca].
-B
However, it hasn't really caught on in a big way - probably for a combination of reasons, including the fact that it's Internet Explorer based, the extra time it takes for the visitor to download the font (even though it's automatic) and also questions from font creators about violations of their copyright.
anyone considdered the extra bandwith involved
better solutions are text replacement with flash (swfs)
or php to include fonts
You can set default fonts with css? I've only just started learning css which was when I read its benefits in an article. I've got scrollbar colours and body, text, header, link and scrollbar colours in 2 css documents and thought I was doing well :(
Don't get me wrong, if you're doing that stuff, you are doing well - just think of the alternative... :-o
With sites that I've done, I've noticed a 50% - 66% reduction in file size when I use CSS.
This seems about right based on the nested-table based sites I've re-built. In some cases, I have reduced page weight by over 80% across entire sites. I've replaced code like this:
<center>
<table width="100%" bgcolor="red" cellspacing="3">
<tr>
<td align="center">
<table width="100%" bgcolor="green" cellpadding="3">
<tr>
<td>
<font size="+2" family="arial" color="#ff9900">Headline</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
...with this:
<h2>headline</h2>
...and this:
h2
{
font-family:arial,helvetica,tahoma,sans-serif;
color:#f90;
text-align:center;
background:#f00;
border:3px solid #00f;
padding:3px 0;
}
...which, if you consider that the css file is typically loaded only once per visit to a site could be a huge reduction in bandwidth, as well as being almost incredibly easy to maintain by comparison...
-B
There's no sure thing here - the web just isn't print. People can always install what they want, overrule your font AND size instructions with their own stylesheet, and so on. However, with a well considered choice of alternative fonts in the font-family, and a layout which is NOT required to pixel perfect, you can do extremely well.
For a serif font, I like to put Georgia early in the chain - it's one of the fonts that looks great on screen and it's common on both Windows and Macintosh. This list performs pretty well and gives a neat and different look than TNR:
font-family:Georgia,Book Antiqua,Palatino,serif;
it provides you with .eot file.
+plus
+you can choose it to contain only those characters that are on your page thus it is not very heavy to download (in my cas it is 12,5kb)
+i've tested it only in opera 7 ie 6 and ff and it works in ff!
-minus
-you cannot (ok, that's me who cannot) use css font family declaration. you need to use <font>
-it is not displayed in opera
-the program interface is made awful
-the setup is 9mb
-you would definitely meet the font you like which is broked or for some other reasons could not be embedded
Using JavaScript and PHP, we can generate accessible image-headings using any font we like. And we don’t have to change the structure of our HTML or CSS at all.
[#*$!.com ]
[edit]The url doesnt show, if im breaking a rule im very sorry, *reading rules now