【发布时间】:2015-02-12 18:50:46
【问题描述】:
我正在尝试为我的 Polymer Chrome 应用程序使用本地字体。我正在尝试在 CSS 中使用@font-face。这是我得到的:
@font-face {
font-family: 'robotolight';
src: url('../../assets/fonts/roboto-light-webfont.eot');
src: url('../../assets/fonts/roboto-light-webfont.eot?#iefix') format('embedded-opentype'),
url('../../assets/fonts/roboto-light-webfont.woff2') format('woff2'),
url('../../assets/fonts/roboto-light-webfont.woff') format('woff'),
url('../../assets/fonts/roboto-light-webfont.ttf') format('truetype'),
url('../../assets/fonts/roboto-light-webfont.svg#robotolight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'robotolight_italic';
src: url('../../assets/fonts/roboto-lightitalic-webfont.eot');
src: url('../../assets/fonts/roboto-lightitalic-webfont.eot?#iefix') format('embedded-opentype'),
url('../../assets/fonts/roboto-lightitalic-webfont.woff2') format('woff2'),
url('../../assets/fonts/roboto-lightitalic-webfont.woff') format('woff'),
url('../../assets/fonts/roboto-lightitalic-webfont.ttf') format('truetype'),
url('../../assets/fonts/roboto-lightitalic-webfont.svg#robotolight_italic') format('svg');
font-weight: normal;
font-style: normal;
}
然后我在这里的 h1 上使用这个字体:
#CaseFiles-h1{
font-family: 'robotolight';
//font-weight: normal; <- no luck
//font-style: normal; <- no luck
}
不幸的是,字体没有加载,我得到了一些默认的衬线字体。
有什么想法吗?
我希望将字体保留在本地,而不是使用 Google 字体或类似的东西。
【问题讨论】:
标签: css fonts polymer google-chrome-app