preboot/angularjs-webpack

custom fonts are not loaded

tobiasbueschel opened this issue · 1 comments

I'm trying to use a custom font by referencing it in app.css. Unfortunately, it only works if I declare it in index.html. Maybe Webpack does not properly resolve the path?

Not working:

/* app.css */

@font-face {
   font-family: "CustomFont";
   src: url(/fonts/Custom-Font.otf) format("opentype");
}

Working:

/* index.html */

<style type="text/css">
@font-face {
   font-family: "CustomFont";
   src: url(/fonts/Custom-Font.otf) format("opentype");
}
</style>
phra commented

that is because of this.

import() and url() are managed by webpack itself so you have to put there the filesystem relative path or disable this feature if you want to let the browser to deal with that.