【发布时间】:2017-04-30 02:03:36
【问题描述】:
在我们的项目中,我们使用 Fira Sans Bold 来加粗文本段。作为后备,我们希望使用 Lucida Sans Unicode 并将 font-weight 设置为 bold。
但是,我们遇到了一个问题,我们需要为 Lucida Sans Unicode 预先设置 font-weight 属性。
有哪些可能的方法来做到这一点?
我们尝试了@font-face。
@font-face {
font-family: 'Lucida Bold';
font-weight: bold;
src: local('Lucida Sans Unicode');
}
但是,问题是,在使用 Fira Sans Bold 时,我们只依赖于 font-family 而没有使用任何其他加粗字体的方法,例如 font-weight:bold, strong、b 等。这对于@font-face 来说是不够的(我在这里提出了问题:What can be the reason for @font-face failing to work?)
如果有任何想法,将不胜感激。
【问题讨论】:
-
如果字体“Fira Sans Bold”本身实际上不是粗体,那么这个名字就不是一个很好的名字。使用这样的名称,无论您是否使用 font-weight:bold,我都希望显示是相同的。
-
无论如何,更一般地说,答案是否定的。您不能拥有与主字体不同的其他子样式的后备字体。没有
font: [[medium 'Arial Black']], [[bold 'Arial']]这样的东西。 -
与your other question 相同的问题:
Lucida Sans Unicode是一个字体系列。Lucida Sans Unicode Bold,一个字体,可能是你需要的。声明 font-weight 将不会合成一个面或从该字体系列中选择。