Proper MIME type for .woff2 fonts

Today I updated Font Awesome package to 4.3.0 and noticed that woff2 font was added. That file is linked in CSS so I need to configure nginx to serve woff2 files properly. Currently I have this block in nginx config for fonts: location ~* \.(otf|eot|woff|ttf)$ { types {font/opentype otf;} types {application/vnd.ms-fontobject eot;} types {font/truetype ttf;} … Read more

How to add fonts to create-react-app based projects?

I’m using create-react-app and prefer not to eject. It’s not clear where fonts imported via @font-face and loaded locally should go. Namely, I’m loading @font-face { font-family: ‘Myriad Pro Regular’; font-style: normal; font-weight: normal; src: local(‘Myriad Pro Regular’), url(‘MYRIADPRO-REGULAR.woff’) format(‘woff’); } Any suggestions? — EDIT Including the gist to which Dan referring in his answer … Read more

How to add multiple font files for the same font?

I’m looking at the MDC page for the @font-face CSS rule, but I don’t get one thing. I have separate files for bold, italic and bold + italic. How can I embed all three files in one @font-face rule? For example, if I have: @font-face { font-family: “DejaVu Sans”; src: url(“./fonts/DejaVuSans.ttf”) format(“ttf”); } strong { … Read more