Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

字蛛不能支持 font-family: inherit #44

Closed
yeelan0319 opened this issue Aug 1, 2015 · 1 comment
Closed

字蛛不能支持 font-family: inherit #44

yeelan0319 opened this issue Aug 1, 2015 · 1 comment
Labels

Comments

@yeelan0319
Copy link

我的字体定义如下

@font-face {
  font-family: 'Han Sans';
  font-style: normal;
  font-weight: 100;
  src: url('../fonts/SourceHanSansSC-ExtraLight.eot');
  src:
    url('../fonts/SourceHanSansSC-ExtraLight.eot?#font-spider') format('embedded-opentype'),
    url('../fonts/SourceHanSansSC-ExtraLight.woff') format('woff'),
    url('../fonts/SourceHanSansSC-ExtraLight.ttf') format('truetype'),
    url('../fonts/SourceHanSansSC-ExtraLight.svg') format('svg');
}
@font-face {
  font-family: 'Han Sans';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/SourceHanSansSC-Light.eot');
  src:
    url('../fonts/SourceHanSansSC-Light.eot?#font-spider') format('embedded-opentype'),
    url('../fonts/SourceHanSansSC-Light.woff') format('woff'),
    url('../fonts/SourceHanSansSC-Light.ttf') format('truetype'),
    url('../fonts/SourceHanSansSC-Light.svg') format('svg');
}
@font-face {
  font-family: 'Han Sans';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/SourceHanSansSC-Regular.eot');
  src:
    url('../fonts/SourceHanSansSC-Regular.eot?#font-spider') format('embedded-opentype'),
    url('../fonts/SourceHanSansSC-Regular.woff') format('woff'),
    url('../fonts/SourceHanSansSC-Regular.ttf') format('truetype'),
    url('../fonts/SourceHanSansSC-Regular.svg') format('svg');
}
@font-face {
  font-family: 'Han Sans';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/SourceHanSansSC-Medium.eot');
  src:
    url('../fonts/SourceHanSansSC-Medium.eot?#font-spider') format('embedded-opentype'),
    url('../fonts/SourceHanSansSC-Medium.woff') format('woff'),
    url('../fonts/SourceHanSansSC-Medium.ttf') format('truetype'),
    url('../fonts/SourceHanSansSC-Medium.svg') format('svg');
}

然后body的css规则是

html, body {
    font-family: "Gotham light","Helvetica Neue", Helvetica, Arial, "Han Sans", sans-serif;
    ...
}

在上述规则中,我并没有定义font-weight,似乎字蛛在font-weight未定义的时候应该是使用的font-weight的默认

font-weight:400

但是我有很多代码里面是使用的

font-family: inherit;(并没有显性的写出来)
font-weight: 100/200/600;

来修改使用的font-weight的,而这部分规则即使css中有@font-face仍然不能被字蛛process。

@aui
Copy link
Owner

aui commented Aug 1, 2015

如果没有声明 weight,会使用默认值 400 的字体

Font-Spider 暂时不支持继承的字体

@aui aui changed the title 字蛛不能支持多个font-weight的WebFont 字蛛不能支持 font-family: inherit Aug 2, 2015
aui pushed a commit that referenced this issue Aug 4, 2015
@aui aui added the bug label Aug 11, 2015
aui pushed a commit that referenced this issue Apr 7, 2016
@aui aui closed this as completed Apr 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants