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

前端 未结 2 965
你的背包
你的背包 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 17:09

    I haven’t actually done anything with font-face, so take this with a pinch of salt, but I don’t think there’s any way for the browser to definitively tell if a given web font installed on a user’s machine or not.

    The user could, for example, have a different font with the same name installed on their machine. The only way to definitively tell would be to compare the font files to see if they’re identical. And the browser couldn’t do that without downloading your web font first.

    Does Firefox download the font when you actually use it in a font declaration? (e.g. h1 { font: 'DejaVu Serif';)?

提交回复
热议问题