You can do it by aliasing a font. This will only work if the font isn't substituted beyond those you suggest (the catch-all-of-type keywords like serif
can't be used here), but you can guarantee that by using a web-font. The web-font may be used as a backup, so you don't need to always download it.
Let's try without a backup first:
@font-face {
font-family: 'Fake Oblique Font';
font-style: normal;
font-weight: 400;
src: local('Bell MT'), local('Georgia');
}
@font-face {
font-family: 'Fake Oblique Font';
font-style: normal;
font-weight: 700;
src: local('Bell MT Bold'), local('Georgia Bold');
}
*
{
font-family: 'Bell MT Bold', Georgia, serif;
}
.oblique
{
font-style: oblique;
font-family: 'Fake Oblique Font';
}
In working out how the "Fake Oblique Font" works, the browser only has the forms mentioned in these declarations available. I don't have Bell MT available on my machine, but this does successfully use Georgia and Georgia Bold with a forced oblique style here: http://jsfiddle.net/k1w1zt0g/ In particular, the x
is most appreciably different between the italic and the fake oblique.
Where this wouldn't work, is if none of the fonts mentioned are available, because local()
declarations can't use the generic labels like serif
. One can either decide to live with that (if you're falling back to serif
then you're falling back from anyway, so you're already a bit off the design you were aiming at), or use a webfont guarantee. MS do license Bell MT for web use, but I'm not going to license it just to write a proof of this, so I'll use Noto Serif from Google Fonts instead:
Noto Serif is a handy choice her, as it provides a full set of normal, bold, italic and bold italic. This allows me to demonstrate a fuller range of changes. Delete the bold-italic font the code below uses and see the browser do more faking to fake that too, by faux-bolding the italic when it's used:
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: 400;
/* There are lots of pros and cons about just how you allow or disallow local fonts
to be used. I'll go with allowing it here, to show it works throughout, but by
all means change this to local('☺') to block local use, or so on. */
src: local('Noto Serif'), local('NotoSerif'), url(http://fonts.gstatic.com/s/notoserif/v4/Lpe_acwQmwESv6cuCHE3rfesZW2xOQ-xsNqO47m55DA.woff) format('woff');
}
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: 700;
src: local('Noto Serif Bold'), local('NotoSerif-Bold'), url(http://fonts.gstatic.com/s/notoserif/v4/lJAvZoKA5NttpPc9yc6lPYSoAJ3FdnHwSRdilZRLja4.woff) format('woff');
}
@font-face {
font-family: 'Noto Serif';
font-style: italic;
font-weight: 400;
src: local('Noto Serif Italic'), local('NotoSerif-Italic'), url(http://fonts.gstatic.com/s/notoserif/v4/HQXBIwLHsOJCNEQeX9kNzxsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
}
@font-face {
font-family: 'Noto Serif Fake Oblique';
font-style: normal;
font-weight: 400;
src: local('Noto Serif'), local('NotoSerif'), url(http://fonts.gstatic.com/s/notoserif/v4/Lpe_acwQmwESv6cuCHE3rfesZW2xOQ-xsNqO47m55DA.woff) format('woff');
}
@font-face {
font-family: 'Noto Serif Fake Oblique';
font-style: normal;
font-weight: 700;
src: local('Noto Serif Bold'), local('NotoSerif-Bold'), url(http://fonts.gstatic.com/s/notoserif/v4/lJAvZoKA5NttpPc9yc6lPYSoAJ3FdnHwSRdilZRLja4.woff) format('woff');
}
*
{
font-family: 'Noto Serif';
}
.oblique
{
font-family: 'Noto Serif Fake Oblique'; /* Force faking, by only providing non-italic, non-oblique forms. */
font-style: oblique;
}
http://jsfiddle.net/k1w1zt0g/1/