Tai*_*ang 3 fonts visual-studio-code vscode-settings
我的工作PC(Windows 7)没有管理员权限,因此无法在系统中安装自定义字体(Fira Code)。有没有一种方法可以在不安装VS Code的情况下使用此类字体?
Tai*_*ang 11
查找此问题的丑陋解决方法:使用webfont。
var styleNode = document.createElement('style');
styleNode.type = "text/css";
var styleText = document.createTextNode(`
@font-face{
font-family: 'Fira Code';
src: url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/eot/FiraCode-Regular.eot') format('embedded-opentype'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff2/FiraCode-Regular.woff2') format('woff2'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/woff/FiraCode-Regular.woff') format('woff'),
url('https://raw.githubusercontent.com/tonsky/FiraCode/master/distr/ttf/FiraCode-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}`);
styleNode.appendChild(styleText);
document.getElementsByTagName('head')[0].appendChild(styleNode);
Run Code Online (Sandbox Code Playgroud)
我找到了一种方法来做到这一点,而不必在每次启动 VS Code 时都运行代码片段。
File > Open Folder导航到您的 VS Code 安装,然后转到:
resources > app > out > vs > code > electron-browser > workbench
打开那个文件夹。
workbench.js使用 VS Code 进行编辑并将 Tai 的代码段添加到它的末尾。
Ctrl+R重新加载窗口,你应该做的!同样,请确保在 VS Code 的字体系列设置中将 Fira Code 作为第一个选项,并确保启用字体连字。
| 归档时间: |
|
| 查看次数: |
1379 次 |
| 最近记录: |