我可以使用常规重量字体来增加重量吗?

时间:2014-03-25 20:58:30

标签: html ios css font-face webfonts

我想使用2种字体:“A-Md”和“A-Bd”。

“A-Bd”看起来比“A-Md”更大胆,但“A-Md”和“A-Bd”字体实际上只有正常重量。

在这种情况下,我想使用“A-Bd”作为“A-Md”的粗体字体。 我写了css:

@font-face {
  font-family: 'A-font';
  font-weight: normal;
  src: local('A-Md');
}
@font-face {
  font-family: 'A-font';
  font-weight: bold;
  src: local('A-Bd');
}
body {
  font-family: 'A-font';
  font-weight: bold;
}

我希望'A-Bd'适用于文本。但是,结果文本的字体是'A-Bd'的粗体文字,看起来很糟糕。

如果我将字体设置为'A-Bd',那么文本就可以了。我想使用'A-Bd'作为我定义的'A-font'的粗体文字。

如何将'A-Bd'本身用作'A-font'的粗体版?

2 个答案:

答案 0 :(得分:0)

编辑:您要做的事情有点不同寻常,尤其是在设计方面,其中较少的字体更多。但你可以用这样的东西来实现它:

@import url(http://fonts.googleapis.com/css?family=Droid+Sans+Mono);
@import url(http://fonts.googleapis.com/css?family=Nothing+You+Could+Do);
@import url(http://fonts.googleapis.com/css?family=Bangers);
@import url(http://fonts.googleapis.com/css?family=Sonsie+One);

b {
    font-family: 'Nothing You Could Do', cursive;
    font-weight: normal;
    }
p {
    font-family: 'Droid Sans Mono', san-serif;
    font-weight: normal;
    }
p#bangers {
    font-family: 'Bangers', cursive;
    font-weight: normal;
}
span.sonsie {
    font-family: 'Sonsie One', cursive;
    font-weight: normal;
}

然后在你的身体里你可以用这种方式应用其他字体:

<p>Main font is Droid Sans Mono and other is <b>Nothing You Could Do</b></p>
<p id="bangers">This is Bangers and <span class="sonsie">this is Sonsie</span></p>

在此处查看我的JSFiddle示例:http://jsfiddle.net/Incredulous/GpJtP/

从这里使用谷歌字体:https://www.google.com/fonts 来源:http://www.456bereastreet.com/archive/201012/font-face_tip_define_font-weight_and_font-style_to_keep_your_css_simple/

答案 1 :(得分:0)

如果您使用标签指定粗体:b,strong,em或任何h#标签(例如),您可以将其设置为显示您的粗体字体&#39;和font-weight:normal;

您甚至可以为多个元素设置这些属性,如下所示:

 b, strong, em  {
      font-weight: normal;
      font-family: 'your bold font';
 }

根据需要将其他类添加到列表中。

相关问题