1

I have a C# MVC project that I changed the font-family. On localhost, it works, but when it's on the server, it's not working.

Localhost: Localhost image

And on the server: Server image

On my _Layout.cshtml (a shared layout) I have the following reference of the font style:

<link rel="stylesheet" href="https://use.typekit.net/idk3wns.css">

And on my site.css file, I put that:

*{
    font-family: indie-flower, sans-serif;
    font-style: normal;
    font-weight: 400;
}

Someone knows why it's happening this and how can I correct that?

Hatsumi
  • 1,948
  • 3
  • 13
  • 28

2 Answers2

4

Your request to the font-family <link rel="stylesheet" href="https://use.typekit.net/idk3wns.css"> is beeing rejected.

A great, reliable and open resource of fonts it Google Fonts. There you can find many fonts and get the links easily.

Specifically in your case, you can use this one:

<link href="https://fonts.googleapis.com/css?family=Indie+Flower" rel="stylesheet">

And use like this:

*{
    font-family: 'Indie Flower', sans-serif;
    font-style: normal;
    font-weight: 400;
}
Felipe Augusto
  • 7,733
  • 10
  • 39
  • 73
1

I could imagine that the difference may be server firewall related, check section 7 of the link below and ensure that the ports are open.

If your network proxy or firewall blocks access to any of the required domains, font sync will not work. Your computer needs to be able to reach these endpoints and download files from them.

Here is a list of the required domains; port 443 also needs to be open.

https://data.typekit.net:443
https://state.typekit.net:443
https://polka.typekit.com:443
https://api.typekit.com:443

Use Typekit's network test page to check these connections from your computer in the web browser.

In-browser Testing

typekit troubleshooting

Community
  • 1
  • 1
Nick B
  • 89
  • 6