force faux bold and oblique website fonts
EDIT this does not work reliably across browsers so ignore all of this
today i found out about a little trick you can use to force the browser to synthesize its own bold and italic for a font, when you really want it to.
i wanted to change my font to be Geneva, to fit with my new Macintosh System 1 inspired theme. it doesnβt have bold and italic styles. with web fonts, if they donβt have bold and italic styles the browser will go ahead and imagine some. this is something people try to avoid. thatβs great for Adobe but im different.
iβm not using web fonts (falling back to other fonts on other platforms). it doesnβt happen with local fonts, though, so what do we do?
@font-face {
font-family: 'Geneva';
font-style: normal;
font-weight: normal;
src: local('Geneva');
}
thatβs right! define a web font @font-face whose only src is the local font you want, and state that it only has a βnormalβ style and weight.
you could also use this to have an alias for your font stack by adding more font names to the src, e.g. βsrc: local('Geneva'), local('Verdana');β but thatβs probably an even worse idea than what iβm already doing!
letβs go