0

I'm using bootstrap with my web application. Everything is working locally, no errors. The application is hosted on Azure where there are also no errors.

My problem is that the web site is not displaying the correct font on Azure which is supposed to be Lato; it's showing Arial instead. I'm using the same browser etc.

This is how boostrap loads the fonts from google api: @import url("//fonts.googleapis.com/css?family=Lato:400,700,400italic"); So it's not an https issue.

I've looked everywhere and can't find a fix. Help?


Edit:

Also included these in web.config:

<staticContent> <mimeMap fileExtension="woff" mimeType="application/font-woff" /> <mimeMap fileExtension="woff2" mimeType="application/font-woff2" /> </staticContent>


Fixed:

The error was because of the order of my css bundle. The solution is explained here: Minification failed. Returning unminified contents

I managed to identify the problem by seeing that the font wasn't loaded under Console > Network in Chrome which led me to find the minimize-error.

Community
  • 1
  • 1
  • Can you share your web application URL? – Gaurav Mantri Jun 03 '16 at 09:49
  • I can't since not a public project. The domain is locked. :/ – Daniel Älvenstrand Jun 03 '16 at 10:00
  • Oh..OK. Please check the developer console (network requests) in the browser to see if there are any errors in loading of resources. That could be one reason for fonts not showing properly. – Gaurav Mantri Jun 03 '16 at 10:08
  • I thought so too, but as I said, no errors what so ever. No console errors, no build errors, only difference is what font is displayed for the same text. It's like Azure forced Arial instead of Lato for some reason. I can change the CSS on the go to only have Lato as font family, but still it's not working... I've configured the application to accept font mimetypes like WOFF etc. which should display errors if misconfigured. – Daniel Älvenstrand Jun 03 '16 at 11:37
  • It doesn't seem to load as many fonts as it should (missing woff2-fonts from modernizr). Seems like that might be it? This is my web.config for the fonts: ` ` It's copy-paste from another solution. Maybe it should be woff2 in mimetype as well? Will return with answers. – Daniel Älvenstrand Jun 03 '16 at 11:43
  • Also changed so modernizr doesn't depend on https. Still works on local but no change in web... I can't solve this problem – Daniel Älvenstrand Jun 03 '16 at 11:56
  • @DanielÄlvenstrand Please post your **Fixed** solution as an answer, not as an edit to the question. That way, this question may be properly marked as answered. – David Makogon Jun 03 '16 at 12:53
  • @DavidMakogon Alright, will do! – Daniel Älvenstrand Jun 07 '16 at 07:44

1 Answers1

0

Fixed:

The error was because of the order of my css bundle. The solution is explained here: Minification failed. Returning unminified contents

I managed to identify the problem by seeing that the font wasn't loaded under Console > Network in Chrome which led me to find the minimize-error.

Community
  • 1
  • 1