How to detect which one of the defined font was used in a web page?

Suppose I have the following CSS rule in my page: ```css body { font-family: Calibri, Trebuchet MS, Helvetica, sans-serif; } ``` How can I detect which one of the defined fonts was used in the user's browser? **Edit for people wondering why I want to do this:** The font I'm detecting contains glyph's that are not available in other fonts and when the user does not have the font I want to display a link asking the user to download that font so they can use my web application with the correct font. Currently I am displaying the download font link for all users, I want to only display this for people who do not have the correct font installed.
A small note of caution: If you are offering a link to download Calibri, be aware that although it is bundled within several Microsoft products, it is not a free font, and you are breaching copyright by offering it for download.

以上就是How to detect which one of the defined font was used in a web page?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准