Roboto from materializecss weird font rendering in Chrome, Firefox, OK with IE?

后端 未结 4 1224
灰色年华
灰色年华 2021-02-12 21:53

I\'m using Materialize CSS coming with the Roboto 2.0 font. Font looks horrible in Chrome 43 and Firefox 37. Surprisingly with IE it looks very good (full resulution):

<

4条回答
  •  别跟我提以往
    2021-02-12 22:41

    It's font OS rendering issue. The simple solution is to use google font like:

     
    

    Or the complex solution, but often the best, is to use @font-face with every type of file format for every browser.

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

提交回复
热议问题