@font-face svg not working properly in Chrome?

前端 未结 5 1809
深忆病人
深忆病人 2020-12-13 01:01

I have an issue with a specific font and the way it\'s rendered in Chrome.

Firefox shows the font properly due to using ttf.

Chrome doesn\'t use antialias a

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 01:28

    When referencing SVG files in @font-face the id (#) in the filepath is specifying the element inside the .svg file. To find the correct id you can open it in an editor and inspect the tag.

    For example:

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

    relates to:

提交回复
热议问题