最近,我在reveal.js演示文稿中使用默认的google作为字体,因为我不得不重新加载浏览器(切换演示文稿),如果没有Wifi,字体缓存就会丢失,无法重建,因此,我最终得到了一个看起来糟糕的默认无衬线字体排版。
所以。我希望包括reveal.js表示的字体,通过npm start和127.0.0.1:8000在笔记本电脑上运行本地,这样浏览器就可以在本地查找字体,就像查找html和css一样,而不需要访问互联网。
这就是我的定制计划:
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap');
// Override theme settings (see ../template/settings.scss)
$mainFont: 'Roboto Condensed', sans-serif;
$headingFont: 'Roboto Condensed', sans-serif;
...如何下载必要的字体,以及如何更改此方案以使用本地字体?
发布于 2021-11-04 13:22:57
你就不能把字体拿过来吗,https://github.com/davidcunningham/roboto-condensed/tree/master/fonts
然后将其添加到样式表中?
@font-face {
font-family: 'RobotoCondensed-Regular';
src: url('/path/to/fonts/RobotoCondensed-Regular.woff') format('woff')
}那就按你的风格来称呼吧
font-family:'RobotoCondensed-Regular';**对每种字体的重量重复,因为这种字体是不可变的。
https://stackoverflow.com/questions/69839574
复制相似问题