Re: Help -- CSS2 Embedding External Font Problem

> Minch Corey wrote:
> 
> Hi to everyone,
> I am having a problem and it is embedding a font using an external
> source.
> 
> What am I doing wrong?  Here is the code
> 
> <style type="text/css">
> <!--
>         @font-face {
>               font-family: "Tango BT";
>               src: url(http://mysite/siteDirectory/)
>                     }

OK so presumably this font resource contains all weights and the default
values for the other font matching characteristics are all what you
want.

>          .title {
>                 font-family: "Tango BT";

fine. Like the validator says you should really have a list here, to
increase the chance that the page displays in a similar way to how you
imagined it. If the browser does not support downloadable fonts, or not
in that format, or the link is down ... then there is no information on
how to proceed.

So something like

     font-family: "Tango BT", "Times New Roman", "Times", serif;

would be more robust (if tango is a serif font and times is an
acceptable fallback)

>                               font-size: 150px;
>                 font-weight: 700;
>                           text-indent: 10px;
>                 vertical-align: top;
>                           color: green;
>                           background: #FFFFFF;
>                   line-height: 0px;
>      }
> ....etc.

OK that al seems fine. What format is the font in, and what browser are
you using to display it? You have two possibilities at this point:

a) IE4 or better, font in "embedded opentype" format (make this with the
weft tool from the microsoft typography website)

b) NS4 or better (or IE4 or better plus Bitstream plug-in), font in
Truedoc pfr format. Make this with HexMac typograph or with the Netscape
composer plug-in.

It is possible to write a single stylesheet that links to different urls
in different formats see the CSS2 spec for examples.

Another problem you may be having is that NS4 supports using CSS to
attach styles (including fonts) but does not support the @font-face
declaration; instead you have to use a link element in the html with
rel=fontdef. This is a temporary hack; hopefully the next version of
Navigator will support the CSS2 syntax.

> 
> All other properties work and I see that it is downloading the TTF
> File but it doesn't
> look like the font, but the fallback font Times Roman.

Ah, sounds like you put a True Type font on the server - nothing wrong
with that except that I am unaware of any implementations that will
download and use a TTF font.

> 
> Anybody have an idea, YES I did check it with the W3 Validator but it
> said I should
> use Generic-Fonts as a last resort.  Is Tango BT a Generic Font?

No, a generic font is a CSS-defined keyword like serif, sans-serif, etc
(again, see the CSS2 spec)


-- 
Chris Lilley, W3C                             http://www.w3.org/
Graphics and Stylesheets Guy      The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)492 387 987         06902 Sophia Antipolis Cedex, France

Received on Friday, 28 August 1998 18:33:40 UTC