Electron + Vue App 上未显示自定义字体
Custom font is not showing on Electron + Vue App
我正在使用 Vue + Electron 开发应用程序,但我遇到了使用自定义字体的问题。当 运行 应用程序处于网络模式时,使用自定义字体的图标显示正常。但是当我使用 electron-builder 构建应用程序时,未加载 icons/custom 字体。
我在 index.html head 标签中导入自定义字体,自定义字体位于 src/renderer/assets/fonts 文件夹中。
任何帮助
谢谢
要确保字体包含在电子中,请尝试这样的操作:
在你的渲染器中main.js
import './scss/app.scss'
在你的'./scss/app.scss'
@font-face {
font-family: 'Your Custom Font';
src: url('../assets/fonts/Your Custom Font.ttf');
}
这应该确保你的字体被 webpack 包含在 electron 中。
我正在使用 Vue + Electron 开发应用程序,但我遇到了使用自定义字体的问题。当 运行 应用程序处于网络模式时,使用自定义字体的图标显示正常。但是当我使用 electron-builder 构建应用程序时,未加载 icons/custom 字体。
我在 index.html head 标签中导入自定义字体,自定义字体位于 src/renderer/assets/fonts 文件夹中。
任何帮助 谢谢
要确保字体包含在电子中,请尝试这样的操作:
在你的渲染器中main.js
import './scss/app.scss'
在你的'./scss/app.scss'
@font-face {
font-family: 'Your Custom Font';
src: url('../assets/fonts/Your Custom Font.ttf');
}
这应该确保你的字体被 webpack 包含在 electron 中。