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