How do I add a small-caps font as a variant?
I’m using Jos Buivenga’s Fontin, which has its small-caps variant as a seperate font rather than as an OpenType-style feature. This CSS snippet properly defines the regular, bold, and italic fonts in the family, but not the small-caps one. How can I make this work?
/* A font by Jos Buivenga (exljbris) -> www.exljbris.com */
@font-face {
font-family: "Fontin";
src: url(../Fonts/Fontin-Regular.ttf) format("truetype");
}
@font-face {
font-family: "Fontin";
font-style: italic;
src: url(../Fonts/Fontin-Italic.ttf) format("truetype");
}
@font-face {
font-family: "Fontin";
font-weight: bold;
src: url(../Fonts/Fontin-Bold.ttf) format("truetype");
}
@font-face {
font-family: "Fontin";
font-variant: small-caps;
src: url(../Fonts/Fontin-SmallCaps.ttf) format("truetype");
}
Related: How to add multiple font files for the same font? and Properly defining font-family in @font-face CSS rules.