fonts - Vuepress 添加字体
问题描述
我在 index.styl 中添加了以下内容:
body {
font-family: "Nunito-SemiBold", Helvetica, san-serif
}
但是在服务器上构建和部署时,喜欢的并没有显示出来。
我什至尝试将其放在根目录(与 index.html 相同)。
想法?
解决方案
在我的情况下,我在下载它之后添加了Plextheme/assets/fonts
字体,然后我创建了其他手写笔文件来定义如下字体:
字体样式
@font-face
font-family 'IBM Plex Sans'
font-style normal
src url('~@theme/assets/fonts/IBM_Plex_Sans/IBMPlexSans-Regular.ttf')
索引样式
/**
* Custom Styles here.
*
* ref:https//v1.vuepress.vuejs.org/config/#index-styl
*/
@require 'fonts'
*
font-family 'IBM Plex Sans' !important
推荐阅读
- angular - 在 Angular 7 中为不同的客户加载不同的索引文件
- android - 航点任务没有暂停
- c# - 当我想为单元格设置值时未处理的异常
- svg - 如何使用 svg 创建多边形?
- delphi - 是否必须在 DeleteFile() 之前检查 FileExists()?
- android - 如何读取 MutableList
到 Parcelable? - android - 检查位图是否被回收无助于解决“RuntimeException:Canvas:尝试使用回收的位图”
- python - 如何在隐藏的输入 Selenium (Python) 上插入值
- robotframework - 引用另一个机器人文件中的关键字
- c# - 事件处理程序在异步方法中引发了两次