How to define bold, italic using @font-face

Posted by Felix on Stack Overflow See other posts from Stack Overflow or by Felix
Published on 2010-03-13T00:34:35Z Indexed on 2010/03/13 0:37 UTC
Read the original article Hit count: 575

Filed under:
|

I'm looking at the MDC page for the @font-face CSS rule, but I don't get one thing. I have separate files for bold, italic and bold + italic, how can I embed all three files in one @font-face rule? For example, if I have:

@font-face {
    font-family: "DejaVu Sans";
    src: url("./fonts/DejaVuSans.ttf") format("ttf");
}
strong {
    font-family: "DejaVu Sans";
    font-weight: bold;
}

The browser will not know what font to use for bold (because that files is DejaVuSansBold.ttf), so it will default to something I probably don't want. How can I tell the browser all the different variants I have for a certain font?

© Stack Overflow or respective owner

Related posts about css

Related posts about font-face