@font-face src: local - How to use the local font if the user already has it?

前端 未结 2 968
你的背包
你的背包 2020-11-27 16:42

What is the right way to use @font-face so that the browser will not download the font if the user already have it?

I am using @font-face to define Deja

2条回答
  •  暖寄归人
    2020-11-27 16:52

    If you want to check for local files first do:

    @font-face {
    font-family: 'Green Sans Web';
    src:
        local('Green Web'),
        local('GreenWeb-Regular'),
        url('GreenWeb.ttf');
    }
    

    There is a more elaborate description of what to do here.

提交回复
热议问题