For a progressive web app based on Material UI (React) and built with Webpack, how do I properly include Roboto font(s) so that the app does not depend
In case the application was started with create-react-app, it doesn't have a [visible] webpack configfile. In this case you can do the following:
create /public/fonts/fonts.css, that defines the @font-faces
@font-face {
font-family: 'inglobal';
font-weight: normal;
font-style: normal;
src: url('./OperatorMono.ttf');
}
Copy font files
add
to /public/index.html's
Hurray!
5/b. If, for any reason, it still doesn't work, change the fonts' extensions to .css (also at src: url('./OperatorMono.css') )