Fontdeck doesn't offer an option to host files yourself, and unfortunately the CSS it returns has different font families for different variations of the font:
@font-face {
font-family: 'Apercu Pro Light';
src: ...;
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'Apercu Pro Bold Italic';
src:...;
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Apercu Pro Regular';
src: null;
font-weight: normal;
font-style: normal;
}
This is highly inconvenient, especially given that they already know correct weight and style. Can I work around this and still use Apercu
as font-family
in my CSS and have browser figure out which font to use?
Since Fontdeck suggests to use webfontloader to load fonts, we can listen to its events and rewrite the inline
<style>
tag it appends as soon as it is available: