W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [css3-fonts] "font-style" and "font-weight" in "@font-face"

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 13 Dec 2011 09:51:27 -0800
Cc: <jackalmage@gmail.com>, <www-style@w3.org>, <Art.Barstow@nokia.com>
Message-Id: <5288FEB0-2531-4459-922E-FD2B970BCB49@gmail.com>
To: <tao.yu@nokia.com>

On Dec 13, 2011, at 9:05 AM, <tao.yu@nokia.com> wrote:

> Well, I updated my page:
> @font-face {
>    	font-family: myFont1;
>    	src: url("fonts/times.ttf");
>    	font-style: italic; 
>    	font-weight: bold;
>    }
> ...........................................
>    #box{ 
>        border: 1px solid red;
>        background-color:#FFF;
>        padding:10px;
>        font-family: myFont1; 
>        font-size:30px;
>        display:inline-block;
>        text-align: center;
>        font-style: italic;
>        font-weight: bold;
>    }
> In the "#box" (the 1st one on the screen), I only get the font, but font-style ('italic') and font-weight ('bold') still do not work for none of the browsers.  
> http://waplabdc.nokia-boston.com/browser/users/temp/font_face_test.html
> is that an issue for the browser?

No. You specified in your @font-face rule that 'font-family: myFont1; font-style: italic; font-weight: bold;' should use the "fonts/times.ttf" font. And that is what you got in your #box rule with those declarations. When you say you only got the font, that is all you should get. If "times.ttf" is not a bold italic font, saying that is is one in the @font-face rule won't change that. If it has multiple faces in it, it is not using them, because @font-face is for only one face per rule; the @rule is only defining the single face that has those descriptors, not the whole family. 

PS This is not the right forum for asking this sort of question. This list is for discussing the further development of CSS, not for learning how existing features work.
Received on Tuesday, 13 December 2011 17:52:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:08 UTC