浏览器渲染人造粗体 - 不是字体粗体

时间:2013-10-10 14:04:53

标签: css fonts font-face

我有一个像这样实现的字体的常规和粗体版本:

@font-face {
  font-family: 'TeXGyreAdventor';
  src: url('../fonts/texgyreadventor-regular-webfont.eot');
  src: url('../fonts/texgyreadventor-regular-webfont.eot?#iefix') format('embedded-opentype'),
  url('../fonts/texgyreadventor-regular-webfont.woff') format('woff'),
  url('../fonts/texgyreadventor-regular-webfont.ttf') format('truetype'),
  url('../fonts/texgyreadventor-regular-webfont.svg#TeXGyreAdventorRegular') format('svg');
  font-weight: normal;
  font-style: normal; }

@font-face {
  font-family: 'TeXGyreAdventor';
  src: url('../fonts/texgyreadventor-bold-webfont.eot');
  src: url('../fonts/texgyreadventor-bold-webfont.eot?#iefix') format('embedded-opentype'),
  url('../fonts/texgyreadventor-bold-webfont.woff') format('woff'),
  url('../fonts/texgyreadventor-bold-webfont.ttf') format('truetype'),
  url('../fonts/texgyreadventor-bold-webfont.svg#TeXGyreAdventorbold') format('svg');
  font-weight: bold;
  font-style: normal; }

body { font-family: 'TeXGyreAdventor'; }

现在我希望CSS中的任何内容都是粗体使用粗体版本的字体和其他所有内容来使用常规版本。唉,这不起作用。浏览器将常规版本用于所有内容并实现它自己的虚假样式。

如果另一方面我实现了这样的字体:

@font-face {
      font-family: 'TeXGyreAdventor';
      src: url('../fonts/texgyreadventor-regular-webfont.eot');
      src: url('../fonts/texgyreadventor-regular-webfont.eot?#iefix') format('embedded-opentype'),
      url('../fonts/texgyreadventor-regular-webfont.woff') format('woff'),
      url('../fonts/texgyreadventor-regular-webfont.ttf') format('truetype'),
      url('../fonts/texgyreadventor-regular-webfont.svg#TeXGyreAdventorRegular') format('svg');
      font-weight: normal;
      font-style: normal; }

    @font-face {
      font-family: 'TeXGyreAdventorBold';
      src: url('../fonts/texgyreadventor-bold-webfont.eot');
      src: url('../fonts/texgyreadventor-bold-webfont.eot?#iefix') format('embedded-opentype'),
      url('../fonts/texgyreadventor-bold-webfont.woff') format('woff'),
      url('../fonts/texgyreadventor-bold-webfont.ttf') format('truetype'),
      url('../fonts/texgyreadventor-bold-webfont.svg#TeXGyreAdventorbold') format('svg');
      font-weight: normal;
      font-style: normal; }

body { font-family: 'TeXGyreAdventor'; }

b,strong { 
  font-weight: normal;
  font-family: 'TeXGyreAdventorBold'; }

然后它的作品!是什么赋予了?我认为第一种方法是假设工作。难道我做错了什么?浏览器是否无法理解粗体是什么并应用正确版本的字体?我不想为任何想要制作粗体的CSS声明一个新的字体系列!

0 个答案:

没有答案
相关问题