我可以强制浏览器使用CSS @ font-face而不是系统上安装的字体吗? [英] Can I force the browser to use CSS @font-face instead of font installed on system?

查看:371
本文介绍了我可以强制浏览器使用CSS @ font-face而不是系统上安装的字体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果浏览器确定客户端操作系统上已安装CSS导入的字体,浏览器是否忽略 @ font-face



我有一些不常见的字体安装在我的系统上进行设计等。看起来,浏览器渲染这些字体有一些细微的差别,这取决于它们是否安装在客户端操作系统上。我猜猜,如果确定字体已经安装在客户端操作系统上,浏览器会忽略CSS字体导入。



这样的问题是这些渲染区别,但是轻微,可以影响间距,定位和对齐,导致我看到一个不同版本的页面比访问者。我必须卸载该字体(每次都很痛苦),或者在虚拟机中预览它(更少痛苦,但仍然痛苦)。



任何方式我可以告诉CSS,只使用这个特定的字体从CSS导入和忽略安装在客户端操作系统上的字体



EDIT:这似乎解决了这个问题:


  1. CSS @ font-face 规范对 font-family 使用不同字符串


  2. 在CSS中引用字体时,请使用:



    font-family:System Installed字体名称,'导入字体名称',Fallback字体;



解决方案

从我的问题中的修改:



问题:


  1. 确保CSS @ font-face font-family 不同字符串。


  2. p>当引用CSS中其他地方的字体时,使用:



    font-family:系统安装的字体名称,'导入的字体名称' ;



Do browsers ignore @font-face if they determine that a CSS-imported font is already installed on the client OS?

I have a number of uncommon fonts installed on my system for design, etc. It would appear that browsers render these fonts with slight differences, depending on whether or not they are installed on the client OS. My guess is that the browser ignores the CSS font import if it determines that the font is already installed on the client OS.

The problem with this is that these rendering distinctions, however slight, can affect spacing, positioning and alignments, causing me to see a different version of a page than visitors. I have to uninstall the font (a pain to do every time) or preview it in a virtual machine (less of a pain, but still a pain).

Is there any way I can tell CSS, "only use this specific font from the CSS import and ignore the font installed on the client OS?"

EDIT : This seems to resolve the issue:

  1. Ensure the CSS @font-face specification uses a different string for font-family than what is installed on the system.

  2. When referencing the font elsewhere in CSS, use:

    font-family: System Installed Font Name, 'Imported Font Name', Fallback Font;

解决方案

From the edit in my question:

This seems to resolve the issue:

  1. Ensure the CSS @font-face specification uses a different string for font-family than what is installed on the system.

  2. When referencing the font elsewhere in CSS, use:

    font-family: System Installed Font Name, 'Imported Font Name', Fallback Font;

这篇关于我可以强制浏览器使用CSS @ font-face而不是系统上安装的字体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆