Search code examples
cssazureweb-configfont-face

Font-face not working on azure


Here I've my css with my font-face :

@font-face {
    font-family: 'bauhaus_93regular';
    src: url('/fonts/bauhaus93-webfont.eot');
    src: url('/fonts/bauhaus93-webfont.eot?#iefix') 
         format('embedded-opentype'), url('/fonts/bauhaus93-webfont.woff2') format('woff2'), url('/fonts/bauhaus93-webfont.woff') format('woff'), url('/fonts/bauhaus93-webfont.ttf') format('truetype'), url('/fonts/bauhaus93-webfont.svg#bauhaus_93regular') format('svg');
    font-weight: normal;
    font-style: normal;
}

And here I've add the following block in my web.config to run custom fonts on azure (when I've deploy my website) :

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <staticContent>
      <remove fileExtension=".svg" />
      <remove fileExtension=".eot" />
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
    </staticContent>
</system.webServer>

That works fine in localhost. Buuuut that's not working when I deploy my website on azure... Someone could help me ? Thanks in advance !


Solution

  • I solve the problem. If I specify directly in the balise the new font-family like this :

    <a class="white" id="TitleGravure"style="font-family:'Bauhaus 93';">
       La gravure dans toutes ses applications
    </a>
    

    It works fine. So for the moment I will do that and after I reconcider the route's bundles... Thanks for the help.