Search code examples
htmlcssfont-face

halvetica bold @font face not working in chrome and safari in mac


@font-face {
  font-family: 'helvetica-bold';  
  src: url("../fonts/helvetica-bold.ttf");     /* IE */
  src: local('helvetica-bold'),     url('../fonts/helvetica-bold.ttf') format('truetype'); /* others */    
}

I am using the font in my site but its not working in mac any one help greatly appreciated

Thanks in advance


Solution

  • You can Try helvetica-bold.eot, .woff and .svg font along with .ttf in font-face.

    There are many sites which are converting .ttf font to .eot and other types (you can google it)

    so your new code will be -

    @font-face {
     font-family: 'helvetica-bold';
     src: url('helvetica-bold.eot'); /* IE9 Compat Modes */
     src: url('helvetica-bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('helvetica-bold.woff') format('woff'), /* Modern Browsers */
       url('helvetica-bold.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('helvetica-bold.svg#svgFontName') format('svg'); /* Legacy iOS */
    }