IE8 Renders font weights randomly

后端 未结 1 1472
孤街浪徒
孤街浪徒 2021-01-06 23:54

On a webpage in IE8 I have 4 custom fonts in CSS using font-face, two of each font go to the same family for bold and normal weights.

I have found that IE8 randomly

相关标签:
1条回答
  • 2021-01-07 00:32

    I've had the same issue when using multiple weights and styles of a single font in IE8. Typekit has an article that explains this bug in IE8 and below: Using multiple weights and styles

    According to them:

    "Internet Explorer 6, 7, & 8 load a maximum of four weights per family. Additionally, using two closely-related weights (e.g., 400 and 500) may result in only one weight loading correctly."

    Using variation specific seems to be the way to solve this. Like so (snippet from a Myfonts.com web font kit):

    @font-face {
      font-family: 'AvenirNextLTPro-DemiIt'; /* Demibold Italic */
      font-style: italic;
      font-weight: 600;
      src: url('webfonts/25A826_1_0.eot');
      src: url('webfonts/25A826_1_0.eot?#iefix') format('embedded-opentype'),url('webfonts/25A826_1_0.woff') format('woff'),url('webfonts/25A826_1_0.ttf') format('truetype');
    }
    
    @font-face {
      font-family: 'AvenirNextLTPro-BoldIt'; /* Bold Italic */
      font-style: italic;
      font-weight: 700;
      src: url('webfonts/25A826_6_0.eot');
      src: url('webfonts/25A826_6_0.eot?#iefix') format('embedded-opentype'),url('webfonts/25A826_6_0.woff') format('woff'),url('webfonts/25A826_6_0.ttf') format('truetype');
    }
    

     

    .someclass {
      font-family: 'AvenirNextLTPro-DemiIt'; /* Demibold Italic */
      font-style: italic;
      font-weight: 600;
    }
    .otherclass {
      font-family: 'AvenirNextLTPro-BoldIt'; /* Bold Italic */
      font-style: italic;
      font-weight: 700;
    }
    
    0 讨论(0)
提交回复
热议问题